From a4ceffcfad90a0df9c3712744fd185b84d7599c7 Mon Sep 17 00:00:00 2001 From: Glence Date: Sat, 4 Feb 2023 14:11:16 +0800 Subject: [PATCH] Small changes for publish build Level1 ai fix Ai speed fix item vel reset back when return player hard set rotation can go to nesxt scene correctly now scoring now checks for trigger --- Assets/CollisionTags.SHConfig | 2 +- Assets/Scenes/Level1Scene.shade | 50 ++++++++++++++----- Assets/Scenes/MainGame.shade | 4 +- Assets/Scripts/Gameplay/Item/SC_Item.cs | 9 +++- .../Gameplay/Player/SC_PlayerController.cs | 4 ++ Assets/Scripts/Gameplay/SC_GameManager.cs | 2 +- Assets/Scripts/Gameplay/SC_ScoringZone.cs | 2 +- 7 files changed, 54 insertions(+), 19 deletions(-) diff --git a/Assets/CollisionTags.SHConfig b/Assets/CollisionTags.SHConfig index 9390b383..3fb14287 100644 --- a/Assets/CollisionTags.SHConfig +++ b/Assets/CollisionTags.SHConfig @@ -2,7 +2,7 @@ 1 Player 1100000000000000 2 Food 1000000000000000 3 Breakable 1100000000000000 -4 ScoringWallCollider 0100000000000000 +4 ScoringWallCollider 0110000000000000 5 Homeowner 1100000000000000 6 Camera 0010000000000000 7 8 0000000000000000 diff --git a/Assets/Scenes/Level1Scene.shade b/Assets/Scenes/Level1Scene.shade index 9606a5f9..145711c2 100644 --- a/Assets/Scenes/Level1Scene.shade +++ b/Assets/Scenes/Level1Scene.shade @@ -2583,7 +2583,7 @@ Components: Transform Component: Translate: {x: 0, y: 0, z: 0} - Rotate: {x: 1.48352981, y: 0, z: 0} + Rotate: {x: -1.48352981, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -2746,13 +2746,13 @@ - EID: 134 Name: CeilingMaster IsActive: true - NumberOfChildren: 49 + NumberOfChildren: 50 Components: Transform Component: - Translate: {x: 0, y: 2.25, z: 0} - Rotate: {x: 0, y: 0, z: 0} + Translate: {x: 0, y: 2.20000005, z: 0} + Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} - IsActive: false + IsActive: true Scripts: ~ - EID: 133 Name: FloorPiece @@ -3489,6 +3489,29 @@ Material: 132690168 IsActive: true Scripts: ~ +- EID: 210 + Name: CeillingCollider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -2.3489778, y: 0, z: -5.81569624} + 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: 15, y: 0.200000003, z: 15} + 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: 142 Name: FloorMaster IsActive: true @@ -4373,14 +4396,14 @@ - Type: Homeowner1 Enabled: true waypointsPool: 234 - patrolSpeed: 0 - chaseSpeed: 0 - turningSpeed: 0 - sightDistance: 0 - eyeOffset: [0, 0, 0] - distanceToCapture: 0 - captureTime: 0 - footstepSFXIntervalMultiplier: 0 + patrolSpeed: 3 + chaseSpeed: 6 + turningSpeed: 5 + sightDistance: 8 + eyeOffset: [0, 1.64999998, 0] + distanceToCapture: 0.5 + captureTime: 0.5 + footstepSFXIntervalMultiplier: 0.5 - EID: 234 Name: ====WaypointPool==== IsActive: true @@ -5141,6 +5164,7 @@ pitchClamp: 45 inverseXControls: true inverseYControls: true + lowerClamp: 5 - EID: 65731 Name: PlayerBag IsActive: true diff --git a/Assets/Scenes/MainGame.shade b/Assets/Scenes/MainGame.shade index 73ea9a83..a07cc67d 100644 --- a/Assets/Scenes/MainGame.shade +++ b/Assets/Scenes/MainGame.shade @@ -10523,8 +10523,8 @@ - Type: Homeowner1 Enabled: true waypointsPool: 166 - patrolSpeed: 1 - chaseSpeed: 2 + patrolSpeed: 3 + chaseSpeed: 6 turningSpeed: 5 sightDistance: 8 eyeOffset: [0, 1.64999998, 0] diff --git a/Assets/Scripts/Gameplay/Item/SC_Item.cs b/Assets/Scripts/Gameplay/Item/SC_Item.cs index 0c8dabe6..49531ab8 100644 --- a/Assets/Scripts/Gameplay/Item/SC_Item.cs +++ b/Assets/Scripts/Gameplay/Item/SC_Item.cs @@ -15,6 +15,7 @@ public class Item : Script public ItemCategory currCategory; public bool returnBack { get; set; } private Transform transform; + private RigidBody rb; private bool playSound = false; private bool caputurePos = false; private Vector3 firstPostion; @@ -25,6 +26,7 @@ public class Item : Script protected override void awake() { transform = GetComponent(); + rb = GetComponent(); collider = GetComponent(); if(collider) collider.GetCollisionShape(0).Density = density; @@ -44,7 +46,12 @@ public class Item : Script { if (returnBack && !dontReturn) { - transform.LocalPosition = firstPostion; + if(transform) + transform.LocalPosition = firstPostion; + + if (rb) + rb.LinearVelocity = Vector3.Zero; + returnBack = false; } } diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 78d8315e..d66e7e30 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -150,6 +150,10 @@ public class PlayerController : Script if(!camArm) camArm = GetComponentInChildren(); + //tempFix + if (tranform) + tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f); + Rotation(); MoveKey(); Sprint(); diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index d1607688..83b0747a 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -111,7 +111,7 @@ public class GameManager : Script multiplierText.GetComponent().LocalScale = Vector3.Zero; } - if ((timer > 0 && totalItemCount < 0) || Input.GetKeyDown(Input.KeyCode.F1)) + if ((timer > 0 && totalItemCount <= 0) || Input.GetKeyDown(Input.KeyCode.F1)) { currGameState = GameState.WIN; //Audio.StopAllSounds(); //Calling this outright breaks audio clip handlers diff --git a/Assets/Scripts/Gameplay/SC_ScoringZone.cs b/Assets/Scripts/Gameplay/SC_ScoringZone.cs index e9d1d0aa..69ee949a 100644 --- a/Assets/Scripts/Gameplay/SC_ScoringZone.cs +++ b/Assets/Scripts/Gameplay/SC_ScoringZone.cs @@ -11,7 +11,7 @@ public class ScoringZone : Script protected override void onTriggerEnter(CollisionInfo info) { - if (GameManager.Instance && info.GameObject.GetScript() && info.GameObject.IsActiveSelf) + if (GameManager.Instance && info.GameObject.GetScript() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent().GetCollisionShape(0).IsTrigger ) { AudioHandler.audioClipHandlers["SFXItemScore"].Play(); GameManager.Instance.Score += info.GameObject.GetScript().Score * GameManager.Instance.currMultiplierCombo;