coin toss re-toss

This commit is contained in:
minenice55 2023-09-21 11:00:04 -04:00
parent 32a4fb26b6
commit 26f8fa52e4
5 changed files with 593 additions and 49 deletions

View file

@ -43,13 +43,16 @@ AnimatorStateMachine:
m_Position: {x: 300, y: -50, z: 0} m_Position: {x: 300, y: -50, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -1162623208037307785} m_State: {fileID: -1162623208037307785}
m_Position: {x: 440, y: 120, z: 0} m_Position: {x: 540, y: -120, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -7899941970589434758} m_State: {fileID: -7899941970589434758}
m_Position: {x: 530, y: 20, z: 0} m_Position: {x: 300, y: -120, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 3911154433124293713} m_State: {fileID: 3911154433124293713}
m_Position: {x: 540, y: -50, z: 0} m_Position: {x: 540, y: -50, z: 0}
- serializedVersion: 1
m_State: {fileID: 5413485298585256804}
m_Position: {x: 540, y: 20, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []
@ -70,8 +73,7 @@ AnimatorState:
m_Name: Catch_success m_Name: Catch_success
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions: []
- {fileID: 3091446025670089204}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
@ -135,28 +137,6 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1101 &3091446025670089204
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7133985828973644718}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.24999997
m_TransitionOffset: 0
m_ExitTime: 0.9999035
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &3911154433124293713 --- !u!1102 &3911154433124293713
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
@ -183,6 +163,32 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &5413485298585256804
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Throw_empty
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 685d134b2d3de58479b44dfdae56572c, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &7133985828973644718 --- !u!1102 &7133985828973644718
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6

View file

@ -0,0 +1,510 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Throw_empty
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: {x: -4.52, y: 1.57, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: -4.52, y: 1.51, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.083333336
value: {x: -4.52, y: 1.55, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Hand
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: {x: 0, y: 0.47, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: 0, y: 0.40999994, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.083333336
value: {x: 0, y: 0.3, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Sleeve
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Hand/catch
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Hand/whoosh
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Hand/Coin
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0.016666668
value: {fileID: -8498782790087183868, guid: eab6bdf53b08c644db9afb05df441329, type: 3}
- time: 0.083333336
value: {fileID: 8877829940631261346, guid: eab6bdf53b08c644db9afb05df441329, type: 3}
attribute: m_Sprite
path: Hand
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2270227889
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 1631782123
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 1792301856
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 403452648
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 1080045770
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 2270227889
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -8498782790087183868, guid: eab6bdf53b08c644db9afb05df441329, type: 3}
- {fileID: 8877829940631261346, guid: eab6bdf53b08c644db9afb05df441329, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: -4.52
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: -4.52
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.083333336
value: -4.52
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Hand
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: 1.57
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 1.51
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.083333336
value: 1.55
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Hand
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.083333336
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Hand
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Hand/catch
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Hand/whoosh
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.083333336
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Sleeve
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: 0.47
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.40999994
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.083333336
value: 0.3
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Sleeve
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.016666668
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.083333336
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Sleeve
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Hand/Coin
classID: 1
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 685d134b2d3de58479b44dfdae56572c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -14,8 +14,8 @@ namespace HeavenStudio.Games.Loaders
{ {
new GameAction("toss", "Toss Coin") new GameAction("toss", "Toss Coin")
{ {
function = delegate { CoinToss.instance.TossCoin(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"], eventCaller.currentEntity["toggle"]); }, function = delegate { CoinToss.instance.TossCoin(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"], eventCaller.currentEntity["toggle"]); },
defaultLength = 7, defaultLength = 7,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("type", CoinToss.CoinVariation.Default, "Variation", "Special Coin Variations"), new Param("type", CoinToss.CoinVariation.Default, "Variation", "Special Coin Variations"),
@ -26,7 +26,7 @@ namespace HeavenStudio.Games.Loaders
{ {
function = delegate { var e = eventCaller.currentEntity; function = delegate { var e = eventCaller.currentEntity;
CoinToss.instance.BackgroundColor(e.beat, e.length, e["colorStart"], e["colorEnd"], e["colorStartF"], e["colorEndF"], e["ease"]); }, CoinToss.instance.BackgroundColor(e.beat, e.length, e["colorStart"], e["colorEnd"], e["colorStartF"], e["colorEndF"], e["ease"]); },
resizable = true, resizable = true,
defaultLength = 4f, defaultLength = 4f,
parameters = new List<Param>() parameters = new List<Param>()
{ {
@ -35,7 +35,7 @@ namespace HeavenStudio.Games.Loaders
new Param("colorStartF", CoinToss.defaultBgColor, "FG Start Color", "The starting color in the fade"), new Param("colorStartF", CoinToss.defaultBgColor, "FG Start Color", "The starting color in the fade"),
new Param("colorEndF", CoinToss.defaultBgColor, "FG End Color", "The ending color in the fade"), new Param("colorEndF", CoinToss.defaultBgColor, "FG End Color", "The ending color in the fade"),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease") new Param("ease", Util.EasingFunction.Ease.Linear, "Ease")
} }
}, },
//left in for backwards-compatibility, but cannot be placed //left in for backwards-compatibility, but cannot be placed
@ -51,9 +51,9 @@ namespace HeavenStudio.Games.Loaders
hidden = true hidden = true
}, },
}, },
new List<string>() {"ntr", "aim"}, new List<string>() { "ntr", "aim" },
"ntrcoin", "en", "ntrcoin", "en",
new List<string>() {} new List<string>() { }
); );
} }
} }
@ -70,6 +70,10 @@ namespace HeavenStudio.Games
//Though it would need a bit of code rewrite to make it work with multiple coins //Though it would need a bit of code rewrite to make it work with multiple coins
public static PlayerInput.InputAction InputAction_TouchFlick =
new("NtrCoinTouchFlick", new int[] { IAEmptyCat, IAFlickCat, IAEmptyCat },
IA_Empty, IA_TouchFlick, IA_Empty);
public static CoinToss instance { get; set; } public static CoinToss instance { get; set; }
private static Color _defaultBgColor; private static Color _defaultBgColor;
@ -82,7 +86,7 @@ namespace HeavenStudio.Games
} }
} }
private static Color _defaultFgColor; private static Color _defaultFgColor;
public static Color defaultFgColor public static Color defaultFgColor
{ {
@ -129,6 +133,13 @@ namespace HeavenStudio.Games
private void Update() private void Update()
{ {
BackgroundColorUpdate(); BackgroundColorUpdate();
if (coin != null && (!coin.canHit) && PlayerInput.GetIsAction(InputAction_TouchFlick))
{
coin.CanHit(true);
isThrowing = true;
handAnimator.Play("Throw_empty", 0, 0);
}
} }
public void TossCoin(double beat, int type, bool audienceReacting) public void TossCoin(double beat, int type, bool audienceReacting)
@ -142,11 +153,11 @@ namespace HeavenStudio.Games
isThrowing = true; isThrowing = true;
switch (type) switch (type)
{ {
case (int) CoinToss.CoinVariation.Cowbell: case (int)CoinVariation.Cowbell:
//this was intentional. it was to avoid the throw and cowbells to go offbeat. //this was intentional. it was to avoid the throw and cowbells to go offbeat.
SoundByte.PlayOneShotGame("coinToss/cowbell1"); SoundByte.PlayOneShotGame("coinToss/cowbell1");
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("coinToss/cowbell2", beat + 1f, offset: 0.01f), new MultiSound.Sound("coinToss/cowbell2", beat + 1f, offset: 0.01f),
new MultiSound.Sound("coinToss/cowbell1", beat + 2f, offset: 0.01f), new MultiSound.Sound("coinToss/cowbell1", beat + 2f, offset: 0.01f),
new MultiSound.Sound("coinToss/cowbell2", beat + 3f, offset: 0.01f), new MultiSound.Sound("coinToss/cowbell2", beat + 3f, offset: 0.01f),
@ -154,11 +165,11 @@ namespace HeavenStudio.Games
new MultiSound.Sound("coinToss/cowbell2", beat + 5f, offset: 0.01f), new MultiSound.Sound("coinToss/cowbell2", beat + 5f, offset: 0.01f),
new MultiSound.Sound("coinToss/cowbell1", beat + 6f, offset: 0.01f), new MultiSound.Sound("coinToss/cowbell1", beat + 6f, offset: 0.01f),
}); });
break; break;
default: default:
break; break;
} }
this.audienceReacting = audienceReacting; this.audienceReacting = audienceReacting;
coin = ScheduleInput(beat, 6f, InputAction_BasicPress, CatchSuccess, CatchMiss, CatchEmpty); coin = ScheduleInput(beat, 6f, InputAction_BasicPress, CatchSuccess, CatchMiss, CatchEmpty);
@ -183,16 +194,16 @@ namespace HeavenStudio.Games
public void CatchSuccess(PlayerActionEvent caller, float state) public void CatchSuccess(PlayerActionEvent caller, float state)
{ {
SoundByte.PlayOneShotGame("coinToss/catch"); SoundByte.PlayOneShotGame("coinToss/catch");
if(this.audienceReacting) SoundByte.PlayOneShot("applause"); if (this.audienceReacting) SoundByte.PlayOneShot("applause");
handAnimator.Play("Catch_success", 0, 0); handAnimator.Play("Catch_success", 0, 0);
isThrowing = false; isThrowing = false;
} }
public void CatchMiss(PlayerActionEvent caller) public void CatchMiss(PlayerActionEvent caller)
{ {
SoundByte.PlayOneShot("miss"); SoundByte.PlayOneShot("miss");
if(this.audienceReacting) SoundByte.PlayOneShot("audience/disappointed"); if (this.audienceReacting) SoundByte.PlayOneShot("audience/disappointed");
handAnimator.Play("Pickup", 0, 0); handAnimator.Play("Pickup", 0, 0);
isThrowing = false; isThrowing = false;

View file

@ -130,10 +130,9 @@ namespace HeavenStudio.Games
) )
{ {
GameObject evtObj = new GameObject("ActionEvent" + (startBeat + timer)); GameObject evtObj = new("ActionEvent" + (startBeat + timer));
evtObj.AddComponent<PlayerActionEvent>();
PlayerActionEvent evt = evtObj.GetComponent<PlayerActionEvent>(); PlayerActionEvent evt = evtObj.AddComponent<PlayerActionEvent>();
evt.startBeat = startBeat; evt.startBeat = startBeat;
evt.timer = timer; evt.timer = timer;
@ -332,6 +331,11 @@ namespace HeavenStudio.Games
return closest; return closest;
} }
public PlayerActionEvent GetClosestScheduledInput(PlayerInput.InputAction action)
{
return GetClosestScheduledInput(action.inputLockCategory);
}
//Hasn't been tested yet. *Should* work. //Hasn't been tested yet. *Should* work.
//Can be used to detect if the user is expected to input something now or not //Can be used to detect if the user is expected to input something now or not
//Useful for strict call and responses games like Tambourine //Useful for strict call and responses games like Tambourine
@ -349,6 +353,11 @@ namespace HeavenStudio.Games
return input.IsExpectingInputNow(); return input.IsExpectingInputNow();
} }
public bool IsExpectingInputNow(PlayerInput.InputAction wantAction)
{
return IsExpectingInputNow(wantAction.inputLockCategory);
}
// now should fix the fast bpm problem // now should fix the fast bpm problem
public static double NgEarlyTime() public static double NgEarlyTime()
{ {