diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index e41192bc..e565b531 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -2544,7 +2544,7 @@ Collider Component: Colliders: - Is Trigger: false - Collision Tag: 0 + Collision Tag: 1 Type: Box Half Extents: {x: 1.79999995, y: 1, z: 4} Friction: 0.400000006 @@ -2553,7 +2553,7 @@ Position Offset: {x: 0, y: 0.550000012, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} - Is Trigger: false - Collision Tag: 0 + Collision Tag: 1 Type: Box Half Extents: {x: 1.79999995, y: 1, z: 2.70000005} Friction: 0.400000006 @@ -4865,9 +4865,9 @@ NumberOfChildren: 5 Components: Transform Component: - Translate: {x: -8, y: 1.142977, z: -4} + Translate: {x: -8, y: 0.899999976, z: -4} Rotate: {x: -0, y: 1.57079649, z: 0} - Scale: {x: 0.999999881, y: 1, z: 0.999999881} + Scale: {x: 0.999965608, y: 1, z: 0.999965608} IsActive: true Renderable Component: Mesh: 149697411 @@ -4978,7 +4978,7 @@ armLength: 3 turnSpeedPitch: 0.200000003 turnSpeedYaw: 0.400000006 - inverseXControls: false + inverseXControls: true inverseYControls: false pitchUpperClamp: 45 pitchLowerClamp: 5 @@ -5097,6 +5097,7 @@ endPoint2: [1, 1.5, -7.5] endPoint3: [2.5, 1.5, -3] playerCamera: 65730 + gameplayCanvas: 459 duration: 3 - EID: 453 Name: PreviewLevel1 @@ -5193,7 +5194,6 @@ Default Texture: 63979907 Hovered Texture: 51379325 Clicked Texture: 66788278 - current texture: 0 IsActive: true UI Component: Canvas ID: 458 @@ -5227,7 +5227,6 @@ Default Texture: 61602036 Hovered Texture: 58910810 Clicked Texture: 57786063 - current texture: 0 IsActive: true UI Component: Canvas ID: 458 @@ -5261,7 +5260,6 @@ Default Texture: 64806384 Hovered Texture: 58347825 Clicked Texture: 63234380 - current texture: 0 IsActive: true UI Component: Canvas ID: 458 diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index d6f58ab0..d068f3ca 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -14082,6 +14082,7 @@ endPoint2: [0, 2, 4.5] endPoint3: [1.14999998, 2.20000005, 2] playerCamera: 4 + gameplayCanvas: 199 duration: 3 - EID: 555 Name: PreviewLevel1 diff --git a/Assets/Scenes/Level3.shade b/Assets/Scenes/Level3.shade index a0782c68..e7ece081 100644 --- a/Assets/Scenes/Level3.shade +++ b/Assets/Scenes/Level3.shade @@ -29,7 +29,7 @@ - EID: 449 Name: Enviroment IsActive: true - NumberOfChildren: 9 + NumberOfChildren: 13 Components: ~ Scripts: ~ - EID: 78 @@ -5690,6 +5690,98 @@ Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ +- EID: 469 + Name: Level2FenceCollider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 1.93802273, y: 2.39508605, z: 4.01721716} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 1 + Type: Box + Half Extents: {x: 6, y: 0.5, z: 0.150000006} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: ~ +- EID: 463 + Name: KitchenLargeClosedWindowCollider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 0 + Type: Box + Half Extents: {x: 4.01900005, y: 1.10099995, z: 0.147} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 1.96599996, y: 1.49399996, z: -0.966000021} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: ~ +- EID: 467 + Name: Level2Table + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 2.11160159, y: 2.4000001, z: 1.2985332} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 1 + Type: Box + Half Extents: {x: 2.20000005, y: 0.5, z: 1.29999995} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: ~ +- EID: 468 + Name: Level2FenceCollider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 4.9960146, y: 2.39508605, z: 2.69112468} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 1 + Type: Box + Half Extents: {x: 0.200000003, y: 0.5, z: 2.5} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: ~ - EID: 553 Name: TweenManager IsActive: true @@ -6439,6 +6531,7 @@ endPoint2: [5, 3.5, 0.5] endPoint3: [-0.5, 1.5, 3.5] playerCamera: 66063 + gameplayCanvas: 526 duration: 3 - EID: 555 Name: PreviewLevel1 @@ -9090,96 +9183,4 @@ Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true - Scripts: ~ -- EID: 469 - Name: Level2FenceCollider - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 1.93802273, y: 2.39508605, z: 4.01721716} - Rotate: {x: -0, y: 0, z: -0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Collider Component: - Colliders: - - Is Trigger: false - Collision Tag: 1 - Type: Box - Half Extents: {x: 6, y: 0.5, z: 0.150000006} - Friction: 0.400000006 - Bounciness: 0 - Density: 1 - Position Offset: {x: 0, y: 0, z: 0} - Rotation Offset: {x: 0, y: 0, z: 0} - IsActive: true - Scripts: ~ -- EID: 468 - Name: Level2FenceCollider - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 4.9960146, y: 2.39508605, z: 2.69112468} - Rotate: {x: -0, y: 0, z: -0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Collider Component: - Colliders: - - Is Trigger: false - Collision Tag: 1 - Type: Box - Half Extents: {x: 0.200000003, y: 0.5, z: 2.5} - Friction: 0.400000006 - Bounciness: 0 - Density: 1 - Position Offset: {x: 0, y: 0, z: 0} - Rotation Offset: {x: 0, y: 0, z: 0} - IsActive: true - Scripts: ~ -- EID: 467 - Name: Level2Table - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 2.11160159, y: 2.4000001, z: 1.2985332} - Rotate: {x: -0, y: 0, z: -0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Collider Component: - Colliders: - - Is Trigger: false - Collision Tag: 1 - Type: Box - Half Extents: {x: 2.20000005, y: 0.5, z: 1.29999995} - Friction: 0.400000006 - Bounciness: 0 - Density: 1 - Position Offset: {x: 0, y: 0, z: 0} - Rotation Offset: {x: 0, y: 0, z: 0} - IsActive: true - Scripts: ~ -- EID: 463 - Name: KitchenLargeClosedWindowCollider - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 0, y: 0, z: 0} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Collider Component: - Colliders: - - Is Trigger: false - Collision Tag: 0 - Type: Box - Half Extents: {x: 4.01900005, y: 1.10099995, z: 0.147} - Friction: 0.400000006 - Bounciness: 0 - Density: 1 - Position Offset: {x: 1.96599996, y: 1.49399996, z: -0.966000021} - Rotation Offset: {x: 0, y: 0, z: 0} - IsActive: true Scripts: ~ \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs index c433f912..2aebc3b7 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs @@ -107,6 +107,7 @@ public partial class LeafSearch : BehaviourTreeNode SetNodeData("isAlert", false); status = BehaviourTreeNodeStatus.FAILURE; onExit(BehaviourTreeNodeStatus.FAILURE); + screamOnce = false; return status; } else @@ -128,6 +129,7 @@ public partial class LeafSearch : BehaviourTreeNode //handleChaseStop(); status = BehaviourTreeNodeStatus.FAILURE; onExit(BehaviourTreeNodeStatus.FAILURE); + screamOnce = false; return status; } @@ -143,6 +145,7 @@ public partial class LeafSearch : BehaviourTreeNode //handleChaseStop(); status = BehaviourTreeNodeStatus.FAILURE; onExit(BehaviourTreeNodeStatus.FAILURE); + screamOnce = false; return status; } @@ -159,6 +162,7 @@ public partial class LeafSearch : BehaviourTreeNode //Debug.Log("Failure: Player has no collider"); status = BehaviourTreeNodeStatus.FAILURE; onExit(BehaviourTreeNodeStatus.FAILURE); + screamOnce = false; return status; } //Ray destination to target the centre of the player's collider instead of transform position @@ -176,6 +180,7 @@ public partial class LeafSearch : BehaviourTreeNode //handleChaseStop(); status = BehaviourTreeNodeStatus.FAILURE; onExit(BehaviourTreeNodeStatus.FAILURE); + screamOnce = false; return status; } else if (sightRayHit.Hit && sightRayHit.Other == player) @@ -222,7 +227,6 @@ public partial class LeafSearch : BehaviourTreeNode if (screamOnce) { - screamOnce = false; AudioHandler.audioClipHandlers["SFXDetectAh"].Play(); } diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index 5dd743d1..8398bb06 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -36,7 +36,6 @@ public class GameManager : Script public bool itemScored {get;set;} public int currMultiplierCombo { get; set;} public float multiplierFont = 60.0f; - private Vector3 fontScalar; public static GameManager Instance { get; private set; } @@ -63,7 +62,6 @@ public class GameManager : Script itemScored = false; currMultiplierCombo = 1; currMultiplierDuration = 0; - fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration); itemShatter = false; GamePause = false; stealFoodPopUpDone = false; @@ -108,6 +106,8 @@ public class GameManager : Script return; } + Cheat(); + if (currGameState == GameState.START) { timer -= Time.DeltaTimeF; @@ -128,12 +128,8 @@ public class GameManager : Script } } - else - { - //multiplierText.GetComponent().LocalScale = Vector3.Zero; - } - if (!goingToLose && ((timer > 0 && totalItemCount <= 0 && !itemShatter) || Input.GetKeyDown(Input.KeyCode.F1))) + if (!goingToLose && ((timer > 0 && totalItemCount <= 0 && !itemShatter))) { currGameState = GameState.WIN; AudioHandler.StopAllSounds(false); @@ -142,7 +138,7 @@ public class GameManager : Script if (SceneFadeInOut.Instance != null) SceneFadeInOut.Instance.CallFadeIn(); } - else if(!goingToWin && (timer < 0 || Input.GetKeyDown(Input.KeyCode.F2))) + else if(!goingToWin && (timer < 0)) { currGameState = GameState.LOSE; AudioHandler.StopAllSounds(false); @@ -181,6 +177,27 @@ public class GameManager : Script } } + private void Cheat() + { + if (Input.GetKeyUp(Input.KeyCode.F1)) + { + currGameState = GameState.WIN; + AudioHandler.StopAllSounds(false); + goingToWin = true; + if (SceneFadeInOut.Instance != null) + SceneFadeInOut.Instance.CallFadeIn(); + } + else if (Input.GetKeyUp(Input.KeyCode.F2)) + { + currGameState = GameState.LOSE; + AudioHandler.StopAllSounds(false); + goingToLose = true; + if (SceneFadeInOut.Instance != null) + SceneFadeInOut.Instance.CallFadeIn(); + } + } + + protected override void onDestroy() { if (Instance == this) diff --git a/Assets/Scripts/Gameplay/SC_PreviewLevel.cs b/Assets/Scripts/Gameplay/SC_PreviewLevel.cs index ca59d538..32a03074 100644 --- a/Assets/Scripts/Gameplay/SC_PreviewLevel.cs +++ b/Assets/Scripts/Gameplay/SC_PreviewLevel.cs @@ -15,6 +15,7 @@ namespace SHADE_Scripting.UI public Vector3 endPoint3; public GameObject playerCamera; + public GameObject gameplayCanvas; public float duration = 3.0f; private bool point1Done = false; @@ -48,6 +49,8 @@ namespace SHADE_Scripting.UI protected override void start() { + if (gameplayCanvas) + gameplayCanvas.SetActive(false); listOfCamera[0].SetMainCamera(); } @@ -77,6 +80,8 @@ namespace SHADE_Scripting.UI if (skip && SceneFadeInOut.Instance && SceneFadeInOut.Instance.FadeOutFinished()) { GameManager.Instance.PreviewLevelDone = true; + if (gameplayCanvas) + gameplayCanvas.SetActive(true); } @@ -152,6 +157,8 @@ namespace SHADE_Scripting.UI if (SceneFadeInOut.Instance && SceneFadeInOut.Instance.FadeOutFinished() && point3Done) { GameManager.Instance.PreviewLevelDone = true; + if (gameplayCanvas) + gameplayCanvas.SetActive(true); } } diff --git a/Assets/Scripts/UI/SC_CutSceneEnd.cs b/Assets/Scripts/UI/SC_CutSceneEnd.cs index acce8bd6..f5007443 100644 --- a/Assets/Scripts/UI/SC_CutSceneEnd.cs +++ b/Assets/Scripts/UI/SC_CutSceneEnd.cs @@ -65,14 +65,14 @@ public class CutsceneEnd : Script Canvas4(); Canvas5(); - if (Input.GetKeyDown(Input.KeyCode.Space) && !skip && (!cutscene4Done || !cutscene5Done)) + if (Input.GetKeyUp(Input.KeyCode.Space) && !skip && (!cutscene4Done || !cutscene5Done)) { skip = true; oldDuration = duration; duration = skipDuration; } - if (Input.GetKeyDown(Input.KeyCode.Space) && cutscene4Done && canvas4.IsActiveSelf) + if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene4Done && canvas4.IsActiveSelf) { canvas4.SetActive(false); canvas5.SetActive(true); @@ -80,7 +80,7 @@ public class CutsceneEnd : Script skip = false; } - if (Input.GetKeyDown(Input.KeyCode.Space) && cutscene5Done && canvas5.IsActiveSelf) + if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene5Done && canvas5.IsActiveSelf) { SceneManager.ChangeScene(nextScene); } diff --git a/Assets/Scripts/UI/SC_CutsceneIntro.cs b/Assets/Scripts/UI/SC_CutsceneIntro.cs index 1f260e03..db393ff9 100644 --- a/Assets/Scripts/UI/SC_CutsceneIntro.cs +++ b/Assets/Scripts/UI/SC_CutsceneIntro.cs @@ -95,14 +95,14 @@ public class CutsceneIntro : Script Canvas2(); Canvas3(); - if (Input.GetKeyDown(Input.KeyCode.Space) && !skip && (!cutscene1Done || !cutscene2Done || !cutscene3Done)) + if (Input.GetKeyUp(Input.KeyCode.Space) && !skip && (!cutscene1Done || !cutscene2Done || !cutscene3Done)) { skip = true; oldDuration = duration; duration = skipDuration; } - if (Input.GetKeyDown(Input.KeyCode.Space) && cutscene1Done && canvas1.IsActiveSelf) + if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene1Done && canvas1.IsActiveSelf) { canvas1.SetActive(false); canvas2.SetActive(true); @@ -110,7 +110,7 @@ public class CutsceneIntro : Script skip = false; } - if (Input.GetKeyDown(Input.KeyCode.Space) && cutscene2Done && canvas2.IsActiveSelf) + if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene2Done && canvas2.IsActiveSelf) { canvas2.SetActive(false); canvas3.SetActive(true); @@ -118,7 +118,7 @@ public class CutsceneIntro : Script skip = false; } - if (Input.GetKeyDown(Input.KeyCode.Space) && cutscene3Done && canvas3.IsActiveSelf) + if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene3Done && canvas3.IsActiveSelf) { SceneManager.ChangeScene(nextScene); } diff --git a/Assets/Scripts/UI/SC_MainMenu.cs b/Assets/Scripts/UI/SC_MainMenu.cs index ffa053b3..8252344d 100644 --- a/Assets/Scripts/UI/SC_MainMenu.cs +++ b/Assets/Scripts/UI/SC_MainMenu.cs @@ -30,26 +30,6 @@ public class MainMenu : Script } protected override void update() { - - if (Input.GetKeyDown(Input.KeyCode.Space)) - { - //Audio.PlaySFXOnce2D("event:/UI/mouse_down_element"); - AudioHandler.audioClipHandlers["SFXMouseDownElement"].Play(); - } - - if (Input.GetKeyUp(Input.KeyCode.Space)) - { - //Audio.PlaySFXOnce2D("event:/UI/success"); - AudioHandler.audioClipHandlers["SFXUISuccess"].Play(); - SceneManager.ChangeScene(sceneID); - Audio.StopAllSounds(); - } - - if (Input.GetKeyDown(Input.KeyCode.Escape)) - { - Audio.StopAllSounds(); - Application.Quit(); - } } } diff --git a/Assets/Scripts/UI/SC_PauseMenu.cs b/Assets/Scripts/UI/SC_PauseMenu.cs index 3e9c7f77..32b59a85 100644 --- a/Assets/Scripts/UI/SC_PauseMenu.cs +++ b/Assets/Scripts/UI/SC_PauseMenu.cs @@ -66,6 +66,9 @@ public class PauseMenu : Script { Audio.StopAllSounds(); SceneManager.RestartScene(); + GameManager.Instance.GamePause = false; + GameManager.Instance.stealFoodPopUpDone = false; + GameManager.Instance.PreviewLevelDone = false; }); } else @@ -92,7 +95,7 @@ public class PauseMenu : Script protected override void update() { - if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause && GameManager.Instance.stealFoodPopUpDone) + if (Input.GetKeyUp(Input.KeyCode.Escape) && !GameManager.Instance.GamePause && GameManager.Instance.stealFoodPopUpDone) { GameManager.Instance.GamePause = true; Input.SetMouseCentering(false); diff --git a/SHADE_Application/src/Application/SBApplication.cpp b/SHADE_Application/src/Application/SBApplication.cpp index 5620e258..74a06667 100644 --- a/SHADE_Application/src/Application/SBApplication.cpp +++ b/SHADE_Application/src/Application/SBApplication.cpp @@ -201,8 +201,6 @@ namespace Sandbox #ifdef SHEDITOR if(editor->editorState == SHEditor::State::PLAY) -#else - window.ClipMouseCursor(); #endif SHSceneManager::SceneUpdate(0.016f); #ifdef SHEDITOR diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index bbbbd1dd..a3573c15 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -555,6 +555,11 @@ namespace SHADE // Create buffer for generic data and attach to descriptor set graphicsGenericData.Init(device, genericAndTextureDescSet); + auto windowDims = window->GetWindowSize(); + + graphicsGenericData.SetViewportWidth(windowDims.first); + graphicsGenericData.SetViewportHeight(windowDims.second); + } /*---------------------------------------------------------------------------------*/