From 0984eee6bb3d71b7489b264267dc97c7de3cdad2 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Thu, 2 Mar 2023 17:34:11 +0800 Subject: [PATCH 1/8] Gameplay UI WIP --- Assets/Scenes/Level2.shade | 45 +++++++++++++++++-- Assets/Scripts/Gameplay/SC_GameManager.cs | 5 +++ Assets/Scripts/UI/EasingHelper.cs | 4 +- Assets/Scripts/UI/SC_MultiplierTextFx.cs | 42 +++++++++++++++-- .../src/Components/TextRenderable.cxx | 13 ++++++ .../src/Components/TextRenderable.hxx | 7 +++ SHADE_Managed/src/Components/Transform.cxx | 1 + 7 files changed, 109 insertions(+), 8 deletions(-) diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index e3de1671..cb330d56 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -4833,14 +4833,14 @@ Enabled: true - EID: 10 Name: Pause Canvas - IsActive: true + IsActive: false NumberOfChildren: 4 Components: Canvas Component: Canvas Width: 1920 Canvas Height: 1080 Scale by canvas width: false - IsActive: true + IsActive: false Scripts: ~ - EID: 8 Name: ResumeButton @@ -13435,4 +13435,43 @@ Components: ~ Scripts: - Type: SHADE_Scripting.UI.TweenManager - Enabled: true \ No newline at end of file + Enabled: true +- EID: 524 + Name: Canvas + IsActive: true + NumberOfChildren: 1 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 525 + Name: StealFoodLogo + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 0, y: 0, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 127459277 + IsActive: true + UI Component: + Canvas ID: 524 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.StealFoodPopUp + Enabled: true + popInDuration: 0.5 + popOutDuration: 0.5 + stayDuration: 1 + rotationAmt: 1800 + scaleAmtX: 538 + scaleAmtY: 377 \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index 00eeadbb..b61928ba 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -90,6 +90,11 @@ public class GameManager : Script protected override void update() { + if (Input.GetKeyDown(Input.KeyCode.G)) + ItemScored(); + + + if (GamePause) { return; diff --git a/Assets/Scripts/UI/EasingHelper.cs b/Assets/Scripts/UI/EasingHelper.cs index d0480f7a..37c54d06 100644 --- a/Assets/Scripts/UI/EasingHelper.cs +++ b/Assets/Scripts/UI/EasingHelper.cs @@ -52,12 +52,12 @@ namespace SHADE_Scripting.UI private static float EaseInSine(float value) { - return (float)(1.0f - Math.Cos((value * Math.PI) / 2.0f)); + return (float)(1.0f - Math.Cos((value * Math.PI / 2.0f) )); } private static float EaseOutSine(float value) { - return (float)(Math.Sin(value * Math.PI) / 2.0f); + return (float)(Math.Sin(value * Math.PI / 2.0f) ); } diff --git a/Assets/Scripts/UI/SC_MultiplierTextFx.cs b/Assets/Scripts/UI/SC_MultiplierTextFx.cs index 1b3129ec..ccd2a4a8 100644 --- a/Assets/Scripts/UI/SC_MultiplierTextFx.cs +++ b/Assets/Scripts/UI/SC_MultiplierTextFx.cs @@ -11,6 +11,7 @@ namespace SHADE_Scripting.UI { [NonSerialized] private TweenThread sizeThread; + private TweenThread sizeInvertThread; private TweenThread alphaThread; @@ -20,6 +21,7 @@ namespace SHADE_Scripting.UI private bool showMultiplier = false; + const float sizeUpDuration = 0.1f; [NonSerialized] private Vector3 defaultScale; @@ -27,6 +29,7 @@ namespace SHADE_Scripting.UI protected override void start() { sizeThread = TweenManager.CreateTweenThread(0.0f, maxSize, minSize, EASING_METHOD.EASE_IN_SINE); + sizeInvertThread = TweenManager.CreateTweenThread(sizeUpDuration, minSize, maxSize, EASING_METHOD.EASE_IN_SINE); alphaThread = TweenManager.CreateTweenThread(0.0f, 1.0f, minAlpha, EASING_METHOD.EASE_OUT_SINE); Transform transform = GetComponent(); if (transform != null) @@ -43,8 +46,29 @@ namespace SHADE_Scripting.UI protected override void update() { Transform transform = GetComponent(); + + if (transform != null && showMultiplier == true) { + if(!sizeInvertThread.IsCompleted()) + { + transform.LocalScale = defaultScale * sizeInvertThread.GetValue(); + + Renderable rend = GetComponentInChildren(); + if(rend) + { + rend.Material.SetProperty("data.alpha", 1.0f); + } + + TextRenderable text = GetComponent(); + if (text) + { + Color clr = text.TextColor; + text.TextColor = new Color(clr.r, clr.g, clr.b, 1.0f); + } + return; + } + if(sizeThread.IsCompleted()) { transform.LocalScale = Vector3.Zero; @@ -53,7 +77,18 @@ namespace SHADE_Scripting.UI else { transform.LocalScale = defaultScale * sizeThread.GetValue(); - GetComponentInChildren().Material.SetProperty("data.alpha",alphaThread.GetValue()); + + Renderable rend = GetComponentInChildren(); + if (rend) + { + rend.Material.SetProperty("data.alpha", alphaThread.GetValue()); + } + TextRenderable text = GetComponent(); + if(text) + { + Color clr = text.TextColor; + text.TextColor = new Color(clr.r,clr.g,clr.b,alphaThread.GetValue() * 1.3f); + } } } } @@ -62,9 +97,10 @@ namespace SHADE_Scripting.UI public void ShowMultiplier(int multiplier, float duration) { GetComponent().Text = $"X {multiplier}"; - sizeThread.duration = duration; - alphaThread.duration = duration; + sizeThread.duration = duration + sizeUpDuration; + alphaThread.duration = duration + sizeUpDuration; + sizeInvertThread.Reset(); sizeThread.Reset(); alphaThread.Reset(); showMultiplier = true; diff --git a/SHADE_Managed/src/Components/TextRenderable.cxx b/SHADE_Managed/src/Components/TextRenderable.cxx index 3eb1f3b9..93d80b65 100644 --- a/SHADE_Managed/src/Components/TextRenderable.cxx +++ b/SHADE_Managed/src/Components/TextRenderable.cxx @@ -19,6 +19,7 @@ of DigiPen Institute of Technology is prohibited. #include "Assets/NativeAsset.hxx" #include "Utility/Convert.hxx" + namespace SHADE { /*---------------------------------------------------------------------------------*/ @@ -55,4 +56,16 @@ namespace SHADE GetNativeComponent()->SetFont(value.NativeObject); } } + + Color TextRenderable::TextColor::get() + { + return Convert::ToCLI(GetNativeComponent()->GetColour()); + } + + void TextRenderable::TextColor::set(Color value) + { + GetNativeComponent()->SetColour(Convert::ToNative(value)); + } + + } diff --git a/SHADE_Managed/src/Components/TextRenderable.hxx b/SHADE_Managed/src/Components/TextRenderable.hxx index b17a919c..b65f9c59 100644 --- a/SHADE_Managed/src/Components/TextRenderable.hxx +++ b/SHADE_Managed/src/Components/TextRenderable.hxx @@ -60,6 +60,13 @@ namespace SHADE FontAsset get(); void set(FontAsset value); } + + property Color TextColor + { + Color get(); + void set(Color value); + } + }; } diff --git a/SHADE_Managed/src/Components/Transform.cxx b/SHADE_Managed/src/Components/Transform.cxx index d5b38967..3216d0f0 100644 --- a/SHADE_Managed/src/Components/Transform.cxx +++ b/SHADE_Managed/src/Components/Transform.cxx @@ -22,6 +22,7 @@ namespace SHADE : Component(entity) {} + /*-----------------------------------------------------------------------------------*/ /* Properties */ /*-----------------------------------------------------------------------------------*/ From a5fe4bf0a031a09d1ee646efc3c1eff322ec0f56 Mon Sep 17 00:00:00 2001 From: mushgunAX Date: Sat, 4 Mar 2023 00:19:35 +0800 Subject: [PATCH 2/8] New SFX and (supposedly) spatial SFX --- Assets/Scenes/Level1.shade | 25 ++++++++++-- Assets/Scenes/Level2.shade | 38 +++++++++++++++++++ Assets/Scripts/Audio/CS_SoundLoopEmitter.cs | 32 ++++++++++++++++ .../Audio/CS_SoundLoopEmitter.cs.shmeta | 3 ++ .../AIBehaviour/Implemented/Homeowner1.cs | 6 +++ Assets/Scripts/Gameplay/Item/SC_Breakable.cs | 12 +++++- Assets/Scripts/Gameplay/Item/SC_Item.cs | 4 ++ Assets/Scripts/Gameplay/SC_GameManager.cs | 4 -- Assets/Scripts/Gameplay/SC_JumpPad.cs | 4 ++ 9 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 Assets/Scripts/Audio/CS_SoundLoopEmitter.cs create mode 100644 Assets/Scripts/Audio/CS_SoundLoopEmitter.cs.shmeta diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index cd5ba82e..5696d196 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -277,7 +277,12 @@ Position Offset: {x: 0, y: 0.5, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.Audio.SoundLoopEmitter + Enabled: true + clipHandlerName: "SFXWash65" + clipPath: "event:/Props/washing_machine_loop" + volume: 0.300000012 - EID: 66 Name: washingMachineDoor IsActive: true @@ -418,7 +423,12 @@ Position Offset: {x: 0, y: 0.5, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.Audio.SoundLoopEmitter + Enabled: true + clipHandlerName: "SFXWash43" + clipPath: "event:/Props/washing_machine_loop" + volume: 0.300000012 - EID: 44 Name: washingMachineDoor IsActive: true @@ -460,7 +470,12 @@ Position Offset: {x: 0, y: 0.5, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.Audio.SoundLoopEmitter + Enabled: true + clipHandlerName: "SFXWash42" + clipPath: "event:/Props/washing_machine_loop" + volume: 0.300000012 - EID: 131081 Name: washingMachineDoor IsActive: true @@ -4121,6 +4136,7 @@ Text: "Score: 0" Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ - EID: 206 @@ -4137,6 +4153,7 @@ Text: "Time Left: 200" Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ - EID: 238 @@ -4153,6 +4170,7 @@ Text: "" Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ - EID: 236 @@ -5302,6 +5320,7 @@ Text: Game Pause Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: false UI Component: Canvas ID: 458 diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index 3989fa4a..9ae69bef 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -464,6 +464,8 @@ Enabled: true threshHold: 0.5 ignoreRaccoon: true + breakClipHandlerName: SFXEggBreak144 + breakClipPath: event:/Props/impact_egg - Type: Item Enabled: true Score: 10 @@ -1652,6 +1654,8 @@ Enabled: true threshHold: 4 ignoreRaccoon: true + breakClipHandlerName: SFXWatermelonBreak464 + breakClipPath: event:/Props/impact_watermelon_break - Type: Item Enabled: true Score: 500 @@ -2064,6 +2068,8 @@ Enabled: true threshHold: 4 ignoreRaccoon: true + breakClipHandlerName: SFXWatermelonBreak522 + breakClipPath: event:/Props/impact_watermelon_break - Type: Item Enabled: true Score: 500 @@ -2374,6 +2380,8 @@ Enabled: true threshHold: 4 ignoreRaccoon: true + breakClipHandlerName: SFXWatermelonBreak156 + breakClipPath: event:/Props/impact_watermelon_break - Type: Item Enabled: true Score: 500 @@ -2684,6 +2692,8 @@ Enabled: true threshHold: 0.5 ignoreRaccoon: true + breakClipHandlerName: SFXEggBreak533 + breakClipPath: event:/Props/impact_egg - Type: Item Enabled: true Score: 10 @@ -2903,6 +2913,8 @@ Enabled: true threshHold: 0.5 ignoreRaccoon: true + breakClipHandlerName: SFXEggBreak538 + breakClipPath: event:/Props/impact_egg - Type: Item Enabled: true Score: 10 @@ -3122,6 +3134,8 @@ Enabled: true threshHold: 0.5 ignoreRaccoon: true + breakClipHandlerName: SFXEggBreak543 + breakClipPath: event:/Props/impact_egg - Type: Item Enabled: true Score: 10 @@ -3477,6 +3491,7 @@ Text: My name is Brandon. Font: 174412429 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -3518,6 +3533,7 @@ Text: My name is Brandon. Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -3539,6 +3555,7 @@ Text: X2 Font: 174412429 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -3803,6 +3820,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak1 + breakClipPath: event:/Props/impact_break - EID: 196 Name: Piece1 IsActive: false @@ -4012,6 +4031,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak171 + breakClipPath: event:/Props/impact_break - EID: 65703 Name: Piece1 IsActive: false @@ -4221,6 +4242,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak150 + breakClipPath: event:/Props/impact_break - EID: 149 Name: Piece1 IsActive: false @@ -4430,6 +4453,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak145 + breakClipPath: event:/Props/impact_break - EID: 488 Name: Piece1 IsActive: false @@ -4639,6 +4664,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak492 + breakClipPath: event:/Props/impact_break - EID: 493 Name: Piece1 IsActive: false @@ -4848,6 +4875,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak497 + breakClipPath: event:/Props/impact_break - EID: 498 Name: Piece1 IsActive: false @@ -5057,6 +5086,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak502 + breakClipPath: event:/Props/impact_break - EID: 503 Name: Piece1 IsActive: false @@ -5266,6 +5297,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak507 + breakClipPath: event:/Props/impact_break - EID: 508 Name: Piece1 IsActive: false @@ -5475,6 +5508,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak512 + breakClipPath: event:/Props/impact_break - EID: 513 Name: Piece1 IsActive: false @@ -5684,6 +5719,8 @@ Enabled: true threshHold: 0.100000001 ignoreRaccoon: false + breakClipHandlerName: SFXBreak517 + breakClipPath: event:/Props/impact_break - EID: 518 Name: Piece1 IsActive: false @@ -6183,6 +6220,7 @@ Text: Game Pause Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: false UI Component: Canvas ID: 10 diff --git a/Assets/Scripts/Audio/CS_SoundLoopEmitter.cs b/Assets/Scripts/Audio/CS_SoundLoopEmitter.cs new file mode 100644 index 00000000..7100a23f --- /dev/null +++ b/Assets/Scripts/Audio/CS_SoundLoopEmitter.cs @@ -0,0 +1,32 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.Audio +{ + public class SoundLoopEmitter : Script + { + [SerializeField] + private string clipHandlerName; + + [SerializeField] + private string clipPath; + + public float volume; + + protected override void awake() + { + AudioHandler.audioClipHandlers[clipHandlerName] = SHADE.Audio.CreateAudioClip(clipPath); + } + + protected override void start() + { + SHADE.Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers[clipHandlerName], GameObject.EntityId); + AudioHandler.audioClipHandlers[clipHandlerName].SetVolume(volume); + AudioHandler.audioClipHandlers[clipHandlerName].Play(); + } + } +} diff --git a/Assets/Scripts/Audio/CS_SoundLoopEmitter.cs.shmeta b/Assets/Scripts/Audio/CS_SoundLoopEmitter.cs.shmeta new file mode 100644 index 00000000..af1a932f --- /dev/null +++ b/Assets/Scripts/Audio/CS_SoundLoopEmitter.cs.shmeta @@ -0,0 +1,3 @@ +Name: CS_SoundLoopEmitter +ID: 154714630 +Type: 9 diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs index e37aab36..952142d2 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs @@ -112,8 +112,14 @@ public partial class Homeowner1 : BehaviourTree AudioHandler.audioClipHandlers["BGMAdaptive"] = Audio.CreateAudioClip("event:/Music/bgm_adaptive"); AudioHandler.audioClipHandlers["SFXFootstep"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_footsteps"); + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXFootstep"], GameObject.EntityId); AudioHandler.audioClipHandlers["SFXDetectAh"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_detect_raccoon"); + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXDetectAh"], GameObject.EntityId); AudioHandler.audioClipHandlers["SFXDetectSting"] = Audio.CreateAudioClip("event:/Music/stingers/player_detected"); + AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming"); + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXHumming"], GameObject.EntityId); + AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f); + AudioHandler.audioClipHandlers["SFXHumming"].Play(); if (aiInstance != null && aiInstance != this) RemoveScript(); diff --git a/Assets/Scripts/Gameplay/Item/SC_Breakable.cs b/Assets/Scripts/Gameplay/Item/SC_Breakable.cs index 4ff49791..a42df17d 100644 --- a/Assets/Scripts/Gameplay/Item/SC_Breakable.cs +++ b/Assets/Scripts/Gameplay/Item/SC_Breakable.cs @@ -14,6 +14,12 @@ public class Breakable : Script public bool isBreak { get; set; } private List itemPieces = new List(); + [SerializeField] + private string breakClipHandlerName; + + [SerializeField] + private string breakClipPath; + protected override void awake() { rb = GetComponent(); @@ -32,7 +38,7 @@ public class Breakable : Script isBreak = false; - AudioHandler.audioClipHandlers["SFXBreak"] = Audio.CreateAudioClip("event:/Props/impact_break"); + AudioHandler.audioClipHandlers[breakClipHandlerName] = Audio.CreateAudioClip(breakClipPath); } protected override void update() @@ -76,7 +82,9 @@ public class Breakable : Script GameManager.Instance.itemShatter = false; isBreak = false; - AudioHandler.audioClipHandlers["SFXBreak"].Play(); + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers[breakClipHandlerName], GameObject.EntityId); + AudioHandler.audioClipHandlers[breakClipHandlerName].Play(); + //Audio.DetachAudioClipFromObject(AudioHandler.audioClipHandlers[breakClipHandlerName]); GameObject.SetActive(false); } } \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/Item/SC_Item.cs b/Assets/Scripts/Gameplay/Item/SC_Item.cs index c8fa1bcd..b315ab08 100644 --- a/Assets/Scripts/Gameplay/Item/SC_Item.cs +++ b/Assets/Scripts/Gameplay/Item/SC_Item.cs @@ -121,11 +121,15 @@ public class Item : Script if (playSound) { + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXImpactElastic"], GameObject.EntityId); + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXImpactHard"], GameObject.EntityId); if (currCategory == ItemCategory.LIGHT) AudioHandler.audioClipHandlers["SFXImpactElastic"].Play(); else if (currCategory == ItemCategory.MEDIUM || currCategory == ItemCategory.HEAVY) AudioHandler.audioClipHandlers["SFXImpactHard"].Play(); playSound = false; + Audio.DetachAudioClipFromObject(AudioHandler.audioClipHandlers["SFXImpactElastic"]); + Audio.DetachAudioClipFromObject(AudioHandler.audioClipHandlers["SFXImpactHard"]); } if (info.GameObject.GetScript() && !returnBack) diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index c16378d9..83dae007 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -91,10 +91,6 @@ public class GameManager : Script AudioHandler.audioClipHandlers["KitchenAmbience"] = Audio.CreateAudioClip("event:/Ambience/roomtone_kitchen"); AudioHandler.audioClipHandlers["KitchenAmbience"].Play(); - AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming"); - AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f); - AudioHandler.audioClipHandlers["SFXHumming"].Play(); - if (SceneFadeInOut.Instance != null) SceneFadeInOut.Instance.CallFadeOut(); Application.IsCursorVisible = false; diff --git a/Assets/Scripts/Gameplay/SC_JumpPad.cs b/Assets/Scripts/Gameplay/SC_JumpPad.cs index 0e331f8c..7aa573df 100644 --- a/Assets/Scripts/Gameplay/SC_JumpPad.cs +++ b/Assets/Scripts/Gameplay/SC_JumpPad.cs @@ -1,10 +1,12 @@ using SHADE; +using SHADE_Scripting.Audio; using System; public class JumpPad : Script { protected override void awake() { + AudioHandler.audioClipHandlers["SFXJumpPad"] = Audio.CreateAudioClip("event:/Props/jumppad_boing"); } protected override void update() @@ -15,6 +17,8 @@ public class JumpPad : Script { if (info.GameObject.GetScript() && info.GameObject.GetScript().currentState == PlayerController.RaccoonStates.FALLING) { + Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXJumpPad"], GameObject.EntityId); + AudioHandler.audioClipHandlers["SFXJumpPad"].Play(); info.GameObject.GetScript().landedOnJumpPad = true; } } From 6d1e179baffea40e5eb0c02666d2193e28ab5306 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sat, 4 Mar 2023 02:46:56 +0800 Subject: [PATCH 3/8] UI doine --- Assets/Scenes/Level2.shade | 30 +++++++++++--- Assets/Scenes/MainMenu.shade | 14 ++++--- Assets/Scripts/Gameplay/SC_GameManager.cs | 9 ++--- Assets/Scripts/UI/SC_ScrollingCredits.cs | 49 +++++++++++++++++++++++ 4 files changed, 86 insertions(+), 16 deletions(-) create mode 100644 Assets/Scripts/UI/SC_ScrollingCredits.cs diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index cb330d56..948964e3 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -2279,18 +2279,38 @@ IsActive: true Scripts: ~ - EID: 206 - Name: Timer + Name: Timer Text IsActive: true - NumberOfChildren: 0 + NumberOfChildren: 1 Components: Transform Component: - Translate: {x: 500, y: 400, z: 0} + Translate: {x: 700, y: 400, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 60, y: 60, z: 60} IsActive: true Text Renderer Component: Text: My name is Brandon. - Font: 176667660 + Font: 174412429 + IsActive: true + UI Component: + Canvas ID: 199 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 526 + Name: Timer BG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.5, y: 0.300000012, z: 0.98999995} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 5, y: 2, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 126220632 IsActive: true UI Component: Canvas ID: 199 @@ -4882,7 +4902,7 @@ Components: Transform Component: Translate: {x: 0, y: -300, z: 0} - Rotate: {x: 0, y: 0, z: 0} + Rotate: {x: 724.5, y: 424.5, z: 59.9999962} Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: diff --git a/Assets/Scenes/MainMenu.shade b/Assets/Scenes/MainMenu.shade index 1edd67b5..6e569b46 100644 --- a/Assets/Scenes/MainMenu.shade +++ b/Assets/Scenes/MainMenu.shade @@ -1100,7 +1100,11 @@ Hovered: false Clicked: false IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.UI.ScrollingCredits + Enabled: true + endY: 4000 + duration: 20 - EID: 48 Name: BackButton IsActive: true @@ -1131,23 +1135,23 @@ canvasToActivate: 0 - EID: 49 Name: Credits Title Text - IsActive: true + IsActive: false NumberOfChildren: 0 Components: Transform Component: Translate: {x: -150, y: 400, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 100, y: 100, z: 1} - IsActive: true + IsActive: false Text Renderer Component: Text: Credits Font: 174412429 - IsActive: true + IsActive: false UI Component: Canvas ID: 46 Hovered: false Clicked: false - IsActive: true + IsActive: false Scripts: ~ - EID: 50 Name: Level Select Canvas diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index b61928ba..0ec3a4e5 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -106,12 +106,10 @@ public class GameManager : Script if(scoreText) scoreText.GetComponent().Text = $"{Score}"; if(timeText) - timeText.GetComponent().Text = $"Time Left: {timer.ToString("0.00")}"; + timeText.GetComponent().Text = $"{timer.ToString("0.00")}"; if (itemScored) { - //multiplierText.GetComponent().Text = $"X {currMultiplierCombo}"; - //multiplierText.GetComponent().LocalScale -= fontScalar * Time.DeltaTimeF; currMultiplierDuration += Time.DeltaTimeF; if (currMultiplierDuration >= maxMultiplierDuration) @@ -170,7 +168,6 @@ public class GameManager : Script totalItemCount -= 1; itemScored = true; currMultiplierDuration = 0; - //multiplierText.GetComponent().LocalScale = new Vector3(multiplierFont, multiplierFont, multiplierFont); if (currMultiplierCombo < maxMultiplierCombo) currMultiplierCombo += 1; @@ -178,9 +175,9 @@ public class GameManager : Script MultiplierTextFx fx = multiplierText.GetScript(); if (fx) { - fx.ShowMultiplier(currMultiplierCombo, maxMultiplierDuration); + fx.ShowMultiplier(currMultiplierCombo, maxMultiplierDuration); } - } + } } diff --git a/Assets/Scripts/UI/SC_ScrollingCredits.cs b/Assets/Scripts/UI/SC_ScrollingCredits.cs new file mode 100644 index 00000000..d4b362d8 --- /dev/null +++ b/Assets/Scripts/UI/SC_ScrollingCredits.cs @@ -0,0 +1,49 @@ +using System; +using SHADE; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class ScrollingCredits: Script + { + + public float endY = 4000.0f; + public float duration = 30.0f; + + + [NonSerialized] + TweenThread thread; + + protected override void awake() + { + base.awake(); + + } + + protected override void start() + { + base.start(); + + Transform transform = GetComponent(); + if(transform != null) + { + thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.EASE_IN_SINE); + } + } + + protected override void update() + { + base.update(); + + Transform transform = GetComponent(); + + if(thread != null && transform != null) + { + transform.LocalPosition = new Vector3( transform.LocalPosition.x ,thread.GetValue() , transform.LocalPosition.z); + } + } + } +} From dc54ae92a2f1eec853e6df3c93b437419da31906 Mon Sep 17 00:00:00 2001 From: mushgunAX Date: Sat, 4 Mar 2023 04:57:59 +0800 Subject: [PATCH 4/8] AI gets sent to a waypoint of choice when caught --- Assets/Scenes/Level2.shade | 25 +++++---- .../AIBehaviour/Implemented/Homeowner1.cs | 5 ++ .../Implemented/LeafNodes/LeafAttack.cs | 30 +++++++++++ .../Implemented/LeafNodes/LeafChase.cs | 3 +- .../Implemented/LeafNodes/LeafPatrol.cs | 51 ++++++++++++++++--- 5 files changed, 97 insertions(+), 17 deletions(-) diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index 3989fa4a..9659dbc5 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -3477,6 +3477,7 @@ Text: My name is Brandon. Font: 174412429 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -3518,6 +3519,7 @@ Text: My name is Brandon. Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -3539,6 +3541,7 @@ Text: X2 Font: 174412429 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -5855,7 +5858,7 @@ Components: ~ Scripts: ~ - EID: 165 - Name: 1 + Name: 0 IsActive: true NumberOfChildren: 0 Components: @@ -5866,7 +5869,7 @@ IsActive: true Scripts: ~ - EID: 164 - Name: 2 + Name: 1 IsActive: true NumberOfChildren: 0 Components: @@ -5877,7 +5880,7 @@ IsActive: true Scripts: ~ - EID: 163 - Name: 3 + Name: 2 IsActive: true NumberOfChildren: 0 Components: @@ -5888,7 +5891,7 @@ IsActive: true Scripts: ~ - EID: 162 - Name: 4 + Name: 3 IsActive: true NumberOfChildren: 0 Components: @@ -5899,7 +5902,7 @@ IsActive: true Scripts: ~ - EID: 161 - Name: 5 + Name: 4 IsActive: true NumberOfChildren: 0 Components: @@ -5910,7 +5913,7 @@ IsActive: true Scripts: ~ - EID: 160 - Name: 6 + Name: 5 IsActive: true NumberOfChildren: 0 Components: @@ -5921,7 +5924,7 @@ IsActive: true Scripts: ~ - EID: 159 - Name: 7 + Name: 6 IsActive: true NumberOfChildren: 0 Components: @@ -5937,7 +5940,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0.0576689839, y: 0, z: -2.61272359} + Translate: {x: -3.45969725, y: 0, z: -2.61272359} Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -5975,12 +5978,13 @@ - Type: Homeowner1 Enabled: true waypointsPool: 166 + startWaypoint: 162 patrolSpeed: 3 chaseSpeed: 6 turningSpeed: 5 sightDistance: 8 eyeOffset: [0, 1.64999998, 0] - distanceToCapture: 0.5 + distanceToCapture: 0.800000012 captureTime: 0.5 footstepSFXIntervalMultiplier: 0.5 - EID: 12 @@ -6110,7 +6114,7 @@ Components: Transform Component: Translate: {x: 0, y: -300, z: 0} - Rotate: {x: -4.5, y: 2, z: -2.5} + Rotate: {x: 3.25, y: 0.5, z: 4.5} Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: @@ -6183,6 +6187,7 @@ Text: Game Pause Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: false UI Component: Canvas ID: 10 diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs index e37aab36..3874c611 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs @@ -37,6 +37,9 @@ public partial class Homeowner1 : BehaviourTree private List waypoints; + [SerializeField] + private GameObject startWaypoint; + [SerializeField] [Tooltip("The AI will patrol at this speed")] private float patrolSpeed; @@ -151,6 +154,8 @@ public partial class Homeowner1 : BehaviourTree SetData("distanceToCapture", distanceToCapture); if (GetData("baseCaptureTime") == null || (float)GetData("baseCaptureTime") != captureTime) SetData("baseCaptureTime", captureTime); + if (GetData("startWaypoint") == null || (GameObject)GetData("startWaypoint") != startWaypoint) + SetData("startWaypoint", startWaypoint); events.Tick(); diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafAttack.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafAttack.cs index 86ac07e0..59470e56 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafAttack.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafAttack.cs @@ -12,6 +12,7 @@ using SHADE; using SHADE_Scripting.AIBehaviour.BehaviourTree; +using SHADE_Scripting.Audio; using System; using System.Collections.Generic; using System.Linq; @@ -98,6 +99,35 @@ public partial class LeafAttack : BehaviourTreeNode if (player.GetScript().stateMachine && !player.GetScript().stateMachine.IsState(typeof(PlayerCaughtState))) player.GetScript().stateMachine.SetState(typeof(PlayerCaughtState)); + //Teleport AI back to home waypoint + int homeIndex = 0; + GameObject? startWaypoint = null; + List? waypoints = (List)GetNodeData("waypoints"); + if (GetNodeData("startWaypoint") != null) + startWaypoint = (GameObject)GetNodeData("startWaypoint"); + if (startWaypoint != null) + { + for (int i = 0; i < waypoints.Count; ++i) + { + if (startWaypoint == waypoints[i]) + { + homeIndex = i; + } + } + } + SetNodeData("currentWaypointIndex", homeIndex); + SetNodeData("playerLastSightedWaypointIndex", homeIndex); + SetNodeData("isAlert", false); + Audio.SetParameterWithLabel("PlayerDetection", "Undetected"); + AudioHandler.audioClipHandlers["SFXHumming"].Play(); + + Transform? transform = (Transform)GetNodeData("transform"); + if (waypoints != null && transform != null) + { + transform.GlobalPosition = waypoints[homeIndex].GetComponent().GlobalPosition; + } + ClearNodeData("target"); + status = BehaviourTreeNodeStatus.SUCCESS; onExit(BehaviourTreeNodeStatus.SUCCESS); return status; diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs index 6085c974..982ee818 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs @@ -60,7 +60,7 @@ public partial class LeafChase : BehaviourTreeNode } } //Debug.Log("Player is nearest " + nearestWaypointIndex); - //Debug.Log("I'm at " + (int)GetNodeData("currentWaypointIndex")); + //Debug.Log("AI going to " + (int)GetNodeData("currentWaypointIndex")); SetNodeData("playerLastSightedWaypointIndex", nearestWaypointIndex); } @@ -78,6 +78,7 @@ public partial class LeafChase : BehaviourTreeNode GetNodeData("distanceToCapture") == null || GetNodeData("baseCaptureTime") == null) { + //Debug.Log("Chase Failure: null values"); status = BehaviourTreeNodeStatus.FAILURE; onExit(BehaviourTreeNodeStatus.FAILURE); return status; diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs index 6199bd19..68f649fa 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs @@ -29,7 +29,7 @@ public partial class LeafPatrol : BehaviourTreeNode private float chaseSpeed; private float turningSpeed; private float retreatTimer = 0.0f; - private int currentWaypointIndex = 0; + private int currentWaypointIndex = -1; private bool retreatState = false; private bool goingForwards = true; @@ -47,7 +47,7 @@ public partial class LeafPatrol : BehaviourTreeNode //node, and hence we do not need to inherit its constructors public LeafPatrol(string name) : base(name) { - currentWaypointIndex = 0; + currentWaypointIndex = -1; } //When it comes to evaluating, @@ -57,6 +57,42 @@ public partial class LeafPatrol : BehaviourTreeNode //Debug.LogWarning("LeafPatrol"); onEnter(BehaviourTreeNodeStatus.RUNNING); + //Initialise home waypoint + waypoints = (List)GetNodeData("waypoints"); + if (currentWaypointIndex == -1) + { + if (waypoints != null) + { + //Debug.Log("Waypoints not null"); + if (GetNodeData("startWaypoint") != null) + { + //Debug.Log("Getting start waypoint"); + GameObject startWaypoint = (GameObject)(GetNodeData("startWaypoint")); + for (int i = 0; i < waypoints.Count; ++i) + { + if (startWaypoint == waypoints[i]) + { + //Debug.Log("Leaf Patrol Constructor: Start Waypoint Index: " + i.ToString()); + currentWaypointIndex = i; + SetNodeData("currentWaypointIndex", i); + } + } + } + else + { + status = BehaviourTreeNodeStatus.FAILURE; + onExit(BehaviourTreeNodeStatus.FAILURE); + return status; + } + } + else + { + status = BehaviourTreeNodeStatus.FAILURE; + onExit(BehaviourTreeNodeStatus.FAILURE); + return status; + } + } + //Get data if (GetNodeData("transform") == null || GetNodeData("patrolSpeed") == null || @@ -104,12 +140,13 @@ public partial class LeafPatrol : BehaviourTreeNode ClearNodeData("isWaiting"); return; } - waypoints = (List)GetNodeData("waypoints"); - if (waypoints == null) + if (GetNodeData("currentWaypointIndex") != null) { - return; + //2023 Mar 4, 0400, this is needed when the AI teleports back to the first spot after catching + currentWaypointIndex = (int)GetNodeData("currentWaypointIndex"); } - Vector3 targetPosition = waypoints[currentWaypointIndex].GetComponent().GlobalPosition; + //Modulo operator to prevent out of range exceptions + Vector3 targetPosition = waypoints[(currentWaypointIndex % waypoints.Count)].GetComponent().GlobalPosition; //Reach waypoint by X and Z being near enough //Do not consider Y of waypoints yet Vector3 remainingDistance = targetPosition - transform.GlobalPosition; @@ -195,6 +232,8 @@ public partial class LeafPatrol : BehaviourTreeNode //Debug.Log("AI is at " + transform.GlobalPosition.x.ToString() + " " + transform.GlobalPosition.y.ToString() + " " + transform.GlobalPosition.z.ToString()); Vector3 normalisedDifference = targetPosition - transform.GlobalPosition; normalisedDifference.y = 0.0f; //Do not move vertically + //Debug.Log("Leaf Patrol Current Waypoint Index: " + currentWaypointIndex.ToString()); + //Debug.Log("True Difference x " + normalisedDifference.x.ToString() + " z " + normalisedDifference.z.ToString()); normalisedDifference /= normalisedDifference.GetMagnitude(); //Debug.Log("Normalised Difference x " + normalisedDifference.x.ToString() + " z " + normalisedDifference.z.ToString()); From 28949b29ff87c825a787c177ba5f1fdf9938a246 Mon Sep 17 00:00:00 2001 From: mushgunAX Date: Sat, 4 Mar 2023 05:07:39 +0800 Subject: [PATCH 5/8] Level 1 AI start waypoint --- Assets/Scenes/Level1.shade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index cd5ba82e..673481e5 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -4121,6 +4121,7 @@ Text: "Score: 0" Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ - EID: 206 @@ -4137,6 +4138,7 @@ Text: "Time Left: 200" Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ - EID: 238 @@ -4153,6 +4155,7 @@ Text: "" Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ - EID: 236 @@ -4225,6 +4228,7 @@ - Type: Homeowner1 Enabled: true waypointsPool: 234 + startWaypoint: 233 patrolSpeed: 3 chaseSpeed: 6 turningSpeed: 5 @@ -5302,6 +5306,7 @@ Text: Game Pause Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: false UI Component: Canvas ID: 458 From 0a8f90ae8010c761b4531608ce55864e8abbdf48 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sat, 4 Mar 2023 12:44:58 +0800 Subject: [PATCH 6/8] Added Gameplay Canvas for Level 1 --- Assets/Scenes/Level1.shade | 205 ++++++++++++++++++++++--------- Assets/Scripts/UI/SC_EndScene.cs | 4 +- 2 files changed, 149 insertions(+), 60 deletions(-) diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index cd5ba82e..3e1e4ad8 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -4101,60 +4101,6 @@ Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ -- EID: 199 - Name: =====Text==== - IsActive: true - NumberOfChildren: 3 - Components: ~ - Scripts: ~ -- EID: 237 - Name: Score - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: -800, y: 400, z: 0.100000001} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 60, y: 60, z: 60} - IsActive: true - Text Renderer Component: - Text: "Score: 0" - Font: 176667660 - Color: {x: 1, y: 1, z: 1, w: 1} - IsActive: true - Scripts: ~ -- EID: 206 - Name: Timer - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 500, y: 400, z: 0.100000001} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 60, y: 60, z: 60} - IsActive: true - Text Renderer Component: - Text: "Time Left: 200" - Font: 176667660 - Color: {x: 1, y: 1, z: 1, w: 1} - IsActive: true - Scripts: ~ -- EID: 238 - Name: Multiplier - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: -800, y: 300, z: 0.100000001} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 60, y: 60, z: 60} - IsActive: true - Text Renderer Component: - Text: "" - Font: 176667660 - Color: {x: 1, y: 1, z: 1, w: 1} - IsActive: true - Scripts: ~ - EID: 236 Name: ====GameManager==== IsActive: true @@ -4169,9 +4115,9 @@ totalItemCount: 4 Score: 0 timer: 200 - scoreText: 237 - timeText: 206 - multiplierText: 238 + scoreText: 449 + timeText: 520 + multiplierText: 139 maxMultiplierDuration: 5 maxMultiplierCombo: 10 multiplierFont: 60 @@ -5302,6 +5248,7 @@ Text: Game Pause Font: 176667660 Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: false UI Component: Canvas ID: 458 @@ -5344,4 +5291,146 @@ Enabled: true alphaValue: 1 fadeInTime: 0.5 - fadeOutTime: 0.5 \ No newline at end of file + fadeOutTime: 0.5 +- EID: 459 + Name: Gameplay Canvas + IsActive: true + NumberOfChildren: 3 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 449 + Name: Score Text + IsActive: true + NumberOfChildren: 1 + Components: + Transform Component: + Translate: {x: -800, y: 365, z: 0.600000024} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 60} + IsActive: true + Text Renderer Component: + Text: My name is Brandon. + Font: 174412429 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 459 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 521 + Name: Score BG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.300000012, y: 0.600000024, z: 0.98999995} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 3.45600009, y: 2, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 127527215 + IsActive: true + UI Component: + Canvas ID: 459 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 520 + Name: Timer Text + IsActive: true + NumberOfChildren: 1 + Components: + Transform Component: + Translate: {x: 700, y: 400, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 60, y: 60, z: 60} + IsActive: true + Text Renderer Component: + Text: My name is Brandon. + Font: 174412429 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 459 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 519 + Name: Timer BG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.5, y: 0.300000012, z: 0.98999995} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 5, y: 2, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 126220632 + IsActive: true + UI Component: + Canvas ID: 459 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 139 + Name: Multiplier Text + IsActive: true + NumberOfChildren: 1 + Components: + Transform Component: + Translate: {x: -800, y: 250, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 50, y: 50, z: 60} + IsActive: true + Text Renderer Component: + Text: X2 + Font: 174412429 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 459 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.MultiplierTextFx + Enabled: true + maxSize: 1 + minSize: 0.300000012 + minAlpha: 0.300000012 +- EID: 518 + Name: Multiplier BG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.400000006, y: 0.400000006, z: 0.98999995} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 4.26499987, y: 2, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 133784677 + IsActive: true + UI Component: + Canvas ID: 459 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ \ No newline at end of file diff --git a/Assets/Scripts/UI/SC_EndScene.cs b/Assets/Scripts/UI/SC_EndScene.cs index 9ab50f9a..3812db2a 100644 --- a/Assets/Scripts/UI/SC_EndScene.cs +++ b/Assets/Scripts/UI/SC_EndScene.cs @@ -17,8 +17,8 @@ public class EndScene : Script protected override void start() { Debug.Log("EndScene::Start():"); - //Input.SetMouseCentering(false); - //Application.IsCursorVisible = true; + Input.SetMouseCentering(false); + Application.IsCursorVisible = true; SceneFadeInOut.Instance.CallFadeOut(); } From c3a452a1c48b8037a48aac76ee863aff8de33db5 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sat, 4 Mar 2023 12:51:19 +0800 Subject: [PATCH 7/8] Pause Canvas Updated with correct button scales and button FX --- Assets/Scenes/Level1.shade | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index 3e1e4ad8..92663fdc 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -2403,7 +2403,7 @@ Components: Transform Component: Translate: {x: 0, y: 0, z: 0} - Rotate: {x: 0, y: 0, z: 0} + Rotate: {x: 0.5, y: -299.5, z: 0.5} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -5167,7 +5167,7 @@ Transform Component: Translate: {x: 0, y: 100, z: 0} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 300, y: 200, z: 500} + Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: Mesh: 141771688 @@ -5183,7 +5183,15 @@ Hovered: false Clicked: false IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 - EID: 456 Name: QuitButton IsActive: true @@ -5192,7 +5200,7 @@ Transform Component: Translate: {x: 0, y: -300, z: 0} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 300, y: 200, z: 500} + Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: Mesh: 141771688 @@ -5208,7 +5216,15 @@ Hovered: false Clicked: false IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 - EID: 455 Name: RetryButton IsActive: true @@ -5217,7 +5233,7 @@ Transform Component: Translate: {x: 0, y: -100, z: 0} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 300, y: 200, z: 500} + Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: Mesh: 141771688 @@ -5233,7 +5249,15 @@ Hovered: false Clicked: false IsActive: true - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 - EID: 454 Name: GamePauseText IsActive: true @@ -5246,7 +5270,7 @@ IsActive: true Text Renderer Component: Text: Game Pause - Font: 176667660 + Font: 174412429 Color: {x: 1, y: 1, z: 1, w: 1} Text Size: {x: 1, y: 1, z: 1} IsActive: false From e7ce3263b80eec45c09ccd470923af60e8f4b85f Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sat, 4 Mar 2023 13:12:02 +0800 Subject: [PATCH 8/8] Level 2 Pause menu update --- Assets/Scenes/Level2.shade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index 8a1da72f..91a116c8 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -6168,7 +6168,7 @@ Components: Transform Component: Translate: {x: 0, y: -300, z: 0} - Rotate: {x: 3.25, y: 0.5, z: 4.5} + Rotate: {x: 0, y: 0, z: 0} Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: @@ -6233,13 +6233,13 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -250, y: 300, z: 0} + Translate: {x: -250, y: 300, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 100, y: 100, z: 100} IsActive: true Text Renderer Component: Text: Game Pause - Font: 176667660 + Font: 174412429 Color: {x: 1, y: 1, z: 1, w: 1} Text Size: {x: 1, y: 1, z: 1} IsActive: false