From afc495b519e8300df70e4a142502ed48191059aa Mon Sep 17 00:00:00 2001 From: KrispyDotlessI <92911290+KrispyDotlessI@users.noreply.github.com> Date: Thu, 8 Sep 2022 20:38:45 +0800 Subject: [PATCH] Face Turns now in-progress and still has yet to animate "Bomb" --- Assets/Resources/Games/marchingOrders.prefab | 24 ++++++ .../Animations/Cadets/FaceL.anim | 2 +- .../Animations/Cadets/FaceR.anim | 2 +- .../Games/MarchingOrders/MarchingOrders.cs | 79 +++++++++++++++++-- 4 files changed, 99 insertions(+), 8 deletions(-) diff --git a/Assets/Resources/Games/marchingOrders.prefab b/Assets/Resources/Games/marchingOrders.prefab index 56463286..8a22baa0 100644 --- a/Assets/Resources/Games/marchingOrders.prefab +++ b/Assets/Resources/Games/marchingOrders.prefab @@ -1238,6 +1238,10 @@ MonoBehaviour: Cadet2: {fileID: 737841632799169188} Cadet3: {fileID: 416600750635270691} CadetPlayer: {fileID: 4446640221286175446} + CadetHead1: {fileID: 5597677561781975540} + CadetHead2: {fileID: 6649403303197644635} + CadetHead3: {fileID: 6030929238039482332} + CadetHeadPlayer: {fileID: 7768596813663215401} Player: {fileID: 4721136555746708586} --- !u!1 &8579906743383480424 GameObject: @@ -1628,6 +1632,11 @@ Animator: m_CorrespondingSourceObject: {fileID: 1674590754458698038, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} m_PrefabInstance: {fileID: 930450041863206205} m_PrefabAsset: {fileID: 0} +--- !u!95 &5597677561781975540 stripped +Animator: + m_CorrespondingSourceObject: {fileID: 4703848696091020489, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} + m_PrefabInstance: {fileID: 930450041863206205} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1366076435959956245 PrefabInstance: m_ObjectHideFlags: 0 @@ -1699,6 +1708,11 @@ Animator: m_CorrespondingSourceObject: {fileID: 1674590754458698038, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} m_PrefabInstance: {fileID: 1366076435959956245} m_PrefabAsset: {fileID: 0} +--- !u!95 &6030929238039482332 stripped +Animator: + m_CorrespondingSourceObject: {fileID: 4703848696091020489, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} + m_PrefabInstance: {fileID: 1366076435959956245} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2089670662784752530 PrefabInstance: m_ObjectHideFlags: 0 @@ -1770,6 +1784,11 @@ Animator: m_CorrespondingSourceObject: {fileID: 1674590754458698038, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} m_PrefabInstance: {fileID: 2089670662784752530} m_PrefabAsset: {fileID: 0} +--- !u!95 &6649403303197644635 stripped +Animator: + m_CorrespondingSourceObject: {fileID: 4703848696091020489, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} + m_PrefabInstance: {fileID: 2089670662784752530} + m_PrefabAsset: {fileID: 0} --- !u!1001 &3064968737360712672 PrefabInstance: m_ObjectHideFlags: 0 @@ -1841,3 +1860,8 @@ Animator: m_CorrespondingSourceObject: {fileID: 1674590754458698038, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} m_PrefabInstance: {fileID: 3064968737360712672} m_PrefabAsset: {fileID: 0} +--- !u!95 &7768596813663215401 stripped +Animator: + m_CorrespondingSourceObject: {fileID: 4703848696091020489, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3} + m_PrefabInstance: {fileID: 3064968737360712672} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceL.anim b/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceL.anim index 0290a70e..1a4dcdd2 100644 --- a/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceL.anim +++ b/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceL.anim @@ -92,7 +92,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceR.anim b/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceR.anim index 54d7f35f..35705b7b 100644 --- a/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceR.anim +++ b/Assets/Resources/Sprites/Games/MarchingOrders/Animations/Cadets/FaceR.anim @@ -92,7 +92,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs b/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs index 07605ad2..38551822 100644 --- a/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs +++ b/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs @@ -59,11 +59,16 @@ namespace HeavenStudio.Games.Loaders inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.HaltSound(e.beat);} }, - //new GameAction("face turn", delegate {}, 4f, false, parameters: new List() - //{ - // new Param("type", MarchingOrders.DirectionFaceTurn.Right, "Direction", "The direction sarge wants the cadets to face"), - // new Param("type2", MarchingOrders.FaceTurnLength.Normal, "Length", "How fast or slow the event lasts"), - //}), + new GameAction("face turn", "Direction to Turn") + { + function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeFaceTurn(e.beat, e["type"], e["type2"]); }, + defaultLength = 4f, + parameters = new List() + { + new Param("type", MarchingOrders.DirectionFaceTurn.Right, "Direction", "The direction sarge wants the cadets to face"), + new Param("type2", MarchingOrders.FaceTurnLength.Normal, "Length", "How fast or slow the event lasts"), + } + }, }); } } @@ -81,14 +86,19 @@ namespace HeavenStudio.Games public Animator Cadet2; public Animator Cadet3; public Animator CadetPlayer; - public GameObject Player; + public Animator CadetHead1; + public Animator CadetHead2; + public Animator CadetHead3; + public Animator CadetHeadPlayer; + public GameObject Player; public GameEvent bop = new GameEvent(); public GameEvent noBop = new GameEvent(); public GameEvent marching = new GameEvent(); private int marchCount; + private int turnLength; public static MarchingOrders instance; @@ -174,6 +184,8 @@ namespace HeavenStudio.Games public void SargeMarch(float beat) { + marchCount = 0; + MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("marchingOrders/march1", beat), new MultiSound.Sound("marchingOrders/march2", beat + 1f), @@ -206,6 +218,61 @@ namespace HeavenStudio.Games }); } + public void SargeFaceTurn(float beat, int type, int type2) + { + switch (type2) + { + case (int) MarchingOrders.FaceTurnLength.Fast: + turnLength = 0; + break; + default: + turnLength = 1; + break; + } + + + switch (type) + { + case (int) MarchingOrders.DirectionFaceTurn.Left: + MultiSound.Play(new MultiSound.Sound[] { + new MultiSound.Sound("marchingOrders/leftFaceTurn1", beat), + new MultiSound.Sound("marchingOrders/leftFaceTurn2", beat + 0.5f), + new MultiSound.Sound("marchingOrders/leftFaceTurn3", beat + turnLength + 1f), + new MultiSound.Sound("marchingOrders/leftFaceTurn4", beat + turnLength + 2f), + }, forcePlay:true); + + BeatAction.New(Player, new List() + { + new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead1.DoScaledAnimationAsync("FaceL", 0.5f);}), + new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead2.DoScaledAnimationAsync("FaceL", 0.5f);}), + new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead3.DoScaledAnimationAsync("FaceL", 0.5f);}), + }); + break; + default: + MultiSound.Play(new MultiSound.Sound[] { + new MultiSound.Sound("marchingOrders/rightFaceTurn1", beat), + new MultiSound.Sound("marchingOrders/rightFaceTurn2", beat + 0.5f), + new MultiSound.Sound("marchingOrders/rightFaceTurn3", beat + turnLength + 1f), + new MultiSound.Sound("marchingOrders/rightFaceTurn4", beat + turnLength + 2f), + }, forcePlay:true); + + BeatAction.New(Player, new List() + { + new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead1.DoScaledAnimationAsync("FaceR", 0.5f);}), + new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead2.DoScaledAnimationAsync("FaceR", 0.5f);}), + new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead3.DoScaledAnimationAsync("FaceR", 0.5f);}), + }); + break; + } + + BeatAction.New(Player, new List() + { + new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}), + new BeatAction.Action(beat + turnLength + 1f, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}), + }); + } + + public static void AttentionSound(float beat) { MultiSound.Play(new MultiSound.Sound[] {