From 96fd8295aabfc59077400bc58210c52fe26c6cc8 Mon Sep 17 00:00:00 2001 From: Glence Date: Sat, 1 Apr 2023 17:22:51 +0800 Subject: [PATCH] audio --- Assets/Audio/SFX.bank | Bin 3429280 -> 3429280 bytes Assets/Navigation Data/Level3_NavData.shnav | Bin 836 -> 836 bytes .../Level3_NavData.shnav.shmeta | 2 +- Assets/Scenes/Level3.shade | 62 ++++++++++++++---- .../AIRework/States/AttackState.cs | 3 +- .../Gameplay/Player/SC_PlayerController.cs | 16 ++--- Assets/Scripts/Gameplay/SC_DecorationAudio.cs | 47 +++++++++++++ .../Gameplay/SC_DecorationAudio.cs.shmeta | 3 + 8 files changed, 110 insertions(+), 23 deletions(-) create mode 100644 Assets/Scripts/Gameplay/SC_DecorationAudio.cs create mode 100644 Assets/Scripts/Gameplay/SC_DecorationAudio.cs.shmeta diff --git a/Assets/Audio/SFX.bank b/Assets/Audio/SFX.bank index 01b66d758619d8b34d99982c92c3399b760db1aa..627402948e529073550e5f727b175a66ccfb50f4 100644 GIT binary patch delta 382 zcmZY1J1hfn0LSrMdsi*0{}%P?Z{>T-S{|?A{v)D zLznfGa8LABM4FCpt5!24_e}ABernb<+kRVAN>d{z9-KV|Iq=wYF? z?%TYVj<+wr4(Hvq^Mmc5oOr2w6-{|})TQN>Yj2~ZJO$L7yW-ZdQ&!-EA1X8i(1svF zXh#P+5k?mx5Qrj%ZuFoRarB`d0~o{*5=bJ2G;|EZzz9Y$hH*?FgDfU7g=x$nhgq1g MkcaI#v$&f7T*H#`;wh6Rm=d5nP|f^b2^AYxNQ41P@} zTvDTO;iAoMx2R=F7ER*68-DEQD$S@+}d*ZZvn5d^u9TCr(&x9Pg{zx}oIf zRaB2@Kdye*IJ=9yvi5H1JNc)N3%8=74eihogMkjjkw7Q9(2XASA_;*M`p}O73?hvo u3}XbN7{fRwkijG*rjSJr)0n|5<}i;1EMf`ESb>RESjfZ1TI5y=_4psV$9RGO diff --git a/Assets/Navigation Data/Level3_NavData.shnav b/Assets/Navigation Data/Level3_NavData.shnav index 42d64e5bb465859f1b26ec459ce759c9eb4e5286..43cab183bde6c20e5715b23cdeff583d3aa1ff5b 100644 GIT binary patch literal 836 zcmcJM%?*M;5QQJ{pf@@YI{|JUDTNN$5-iEYMz#!2jBjREP$3XvoWthJV}2hE8UR(r zhjFWbQw@X?xYn10i5rg;njovuozZ&2I+bIdQ|7Z-yFfOV39WD76hw~DF2$c|kS@*m zB3s$Ck=#esmZ)fB$mkCH&51ukqn9ob@BNYPqK0Xg56aQ&3~G6_X>*G5NMGMcZ_~jflcTHD_%q)X-o73(y?63 literal 836 zcmcJM%?-jZ422)+A;*pYgH)ouaqLEA6h`SNWrGY*$=J^!LTQQwh#ag>&-LHyh!H^F zYtVP=H4MP@3|xj&V;UfVQQp1|bIMm}%34Vr0IRJK=c+#Y2CyzcKMjARRj=?FyTnbI z&E(6QR-?9yb3=D3)Otk}Nu>AwNQ=nPyA-t84Aa!aDn+@cY(Zib)LuwiCG87Zb8SHf fGlbff+$+l_;ziCMxTeR*M2DWlze8=GJhP1tA2FnT diff --git a/Assets/Navigation Data/Level3_NavData.shnav.shmeta b/Assets/Navigation Data/Level3_NavData.shnav.shmeta index 211b87b7..02c68390 100644 --- a/Assets/Navigation Data/Level3_NavData.shnav.shmeta +++ b/Assets/Navigation Data/Level3_NavData.shnav.shmeta @@ -1,3 +1,3 @@ Name: Level3_NavData -ID: 263362242 +ID: 252819653 Type: 15 diff --git a/Assets/Scenes/Level3.shade b/Assets/Scenes/Level3.shade index 6e63cb6e..f1e2a19f 100644 --- a/Assets/Scenes/Level3.shade +++ b/Assets/Scenes/Level3.shade @@ -1,4 +1,4 @@ -- NavData: 263362242 +- NavData: 252819653 - EID: 0 Name: Light_Direction IsActive: true @@ -6,7 +6,7 @@ Components: Transform Component: Translate: {x: -4.64838362, y: 2.94342947, z: 0.209690213} - Rotate: {x: 6.41686916, y: 0.727440596, z: 2.90124035} + Rotate: {x: 2.99841309, y: 1.61244416, z: -0.287879944} Scale: {x: 1, y: 1, z: 1} IsActive: true Light Component: @@ -3626,7 +3626,7 @@ Components: Transform Component: Translate: {x: 2.75, y: 0, z: 6.25} - Rotate: {x: 0, y: 0, z: 0} + Rotate: {x: -0, y: 0, z: -0} Scale: {x: 0.75, y: 0.75, z: 0.75} IsActive: true Renderable Component: @@ -5367,7 +5367,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 3.25, y: 0, z: 7.55967045} + Translate: {x: 3.47301221, y: 0, z: 8.17157459} Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -10590,7 +10590,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 2.91941047, y: 0.527999997, z: 7.41522264} + Translate: {x: 2.91941047, y: 0.527999997, z: 8.10036278} Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -14794,8 +14794,8 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 3.65231538, y: 0.438600183, z: 7.60280371} - Rotate: {x: 0, y: 0, z: 0} + Translate: {x: 3.65231538, y: 0.438600183, z: 8.16182518} + Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -15265,7 +15265,13 @@ Color Decay: {x: 0, y: 0, z: 0, w: 0} Acceleration: {x: 0, y: -0.100000001, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: DecorationAudio + Enabled: true + name: spark1 + audio: event:/Props/sparks + loop: false + timeDruation: 2.29999995 - EID: 608 Name: Light particles IsActive: true @@ -15299,7 +15305,13 @@ Color Decay: {x: 0, y: 0, z: 0, w: 0} Acceleration: {x: 0, y: -0.100000001, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: DecorationAudio + Enabled: true + name: spark2 + audio: event:/Props/sparks + loop: false + timeDruation: 3.20000005 - EID: 609 Name: Light particles IsActive: true @@ -15333,7 +15345,13 @@ Color Decay: {x: 0, y: 0, z: 0, w: 0} Acceleration: {x: 0, y: -0.100000001, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: DecorationAudio + Enabled: true + name: spark3 + audio: event:/Props/sparks + loop: false + timeDruation: 2.5 - EID: 610 Name: Light particles IsActive: true @@ -15367,7 +15385,13 @@ Color Decay: {x: 0, y: 0, z: 0, w: 0} Acceleration: {x: 0, y: -0.100000001, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: DecorationAudio + Enabled: true + name: spark4 + audio: event:/Props/sparks + loop: false + timeDruation: 3.29999995 - EID: 611 Name: Water particles IsActive: true @@ -15435,7 +15459,13 @@ Color Decay: {x: 0, y: 0, z: 0, w: 0} Acceleration: {x: 0, y: -0.100000001, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: DecorationAudio + Enabled: true + name: spark5 + audio: event:/Props/sparks + loop: false + timeDruation: 2.29999995 - EID: 613 Name: Water particles IsActive: true @@ -15469,7 +15499,13 @@ Color Decay: {x: 0, y: 0, z: 0, w: 0} Acceleration: {x: 0, y: -0.899999976, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: DecorationAudio + Enabled: true + name: water2 + audio: event:/Props/tap_loop + loop: true + timeDruation: 0.5 - EID: 615 Name: Water particles IsActive: true diff --git a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/AttackState.cs b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/AttackState.cs index a826c170..8563e823 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/AttackState.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/AttackState.cs @@ -92,7 +92,8 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States { raccoonCaught = true; Transform pcTransform = ai.player.GetComponent(); - Transform netTransform = ai.attackHitbox.GetComponentInChildren(); + ai.player.GetScript().Caught(); + Transform netTransform = ai.attackHitbox.GetComponentInChildren(); if (pcTransform && netTransform) { pcTransform.GlobalPosition = netTransform.GlobalPosition; diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 6276b96d..9d142e4c 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -435,10 +435,13 @@ public class PlayerController : Script } if (!isGrounded && rb != null && (rb.LinearVelocity.y < 0.0f || Input.GetKeyUp(Input.KeyCode.Space))) - { - currentState = RaccoonStates.FALLING; - if (stateMachine && !stateMachine.IsState(typeof(PlayerFallState))) - stateMachine.SetState(typeof(PlayerFallState)); + { + if (currentState != RaccoonStates.CAUGHT) + { + currentState = RaccoonStates.FALLING; + if (stateMachine && !stateMachine.IsState(typeof(PlayerFallState))) + stateMachine.SetState(typeof(PlayerFallState)); + } } } @@ -544,11 +547,8 @@ public class PlayerController : Script public void Reset() { - //Debug.Log("PlayerController: Raccon Reset " + currentState); - - if (currentState == RaccoonStates.CAUGHT && tranform && respawnPoint) + if (tranform && respawnPoint) { - //Debug.Log("PlayerController: Raccon Reset inside if " + currentState); currentState = RaccoonStates.IDLE; if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState))) stateMachine.SetState(typeof(PlayerIdleState)); diff --git a/Assets/Scripts/Gameplay/SC_DecorationAudio.cs b/Assets/Scripts/Gameplay/SC_DecorationAudio.cs new file mode 100644 index 00000000..55b35a0b --- /dev/null +++ b/Assets/Scripts/Gameplay/SC_DecorationAudio.cs @@ -0,0 +1,47 @@ +using SHADE; +using SHADE_Scripting.Audio; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +public class DecorationAudio : Script +{ + public string name = "REPLACETHIS"; + public string audio = "event:/UI/botton_hover"; + public bool loop = true; + public float timeDruation = 0.5f; + private float timer = 0.0f; + + protected override void awake() + { + if (audio != "Empty") + { + AudioHandler.audioClipHandlers[name] = Audio.CreateAudioClip(audio); + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers[name], GameObject.EntityId); + } + } + + protected override void start() + { + if (loop) + AudioHandler.audioClipHandlers[name].Play(); + + } + + protected override void update() + { + if (!loop) + { + timer += Time.DeltaTimeF; + if (timer > timeDruation) + { + timer = 0.0f; + AudioHandler.audioClipHandlers[name].Play(); + } + } + } + +} + diff --git a/Assets/Scripts/Gameplay/SC_DecorationAudio.cs.shmeta b/Assets/Scripts/Gameplay/SC_DecorationAudio.cs.shmeta new file mode 100644 index 00000000..f38b5a95 --- /dev/null +++ b/Assets/Scripts/Gameplay/SC_DecorationAudio.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_DecorationAudio +ID: 166447267 +Type: 9