diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index e06548c0..5d611b34 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -4530,7 +4530,7 @@ Drag: 0.00999999978 Angular Drag: 0.100000001 Use Gravity: true - Interpolate: true + Interpolate: false Sleeping Enabled: true Freeze Position X: false Freeze Position Y: false @@ -4581,7 +4581,7 @@ Drag: 0.00999999978 Angular Drag: 0.100000001 Use Gravity: true - Interpolate: true + Interpolate: false Sleeping Enabled: true Freeze Position X: false Freeze Position Y: false @@ -4632,7 +4632,7 @@ Drag: 0.00999999978 Angular Drag: 0.100000001 Use Gravity: true - Interpolate: true + Interpolate: false Sleeping Enabled: true Freeze Position X: false Freeze Position Y: false @@ -5090,7 +5090,7 @@ Interpolate: false Sleeping Enabled: true Freeze Position X: false - Freeze Position Y: true + Freeze Position Y: false Freeze Position Z: false Freeze Rotation X: true Freeze Rotation Y: true @@ -5124,6 +5124,8 @@ lightMultiper: 0.75 mediumMultiper: 0.5 heavyMultiper: 0.25 + silhouettePlayer: 462 + silhouetteBag: 465 - Type: PickAndThrow Enabled: true throwForce: [8, 10, 8] @@ -5131,8 +5133,6 @@ delayTimer: 1 aimingLength: 0.899999976 throwItem: false - silhouettePlayer: 462 - silhouetteBag: 465 rayDistance: 0.5 rayHeight: 0.100000001 aimingFOV: 50 diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index 47b32e34..3caea55a 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -2321,7 +2321,7 @@ Interpolate: false Sleeping Enabled: true Freeze Position X: false - Freeze Position Y: true + Freeze Position Y: false Freeze Position Z: false Freeze Rotation X: true Freeze Rotation Y: true @@ -2355,6 +2355,8 @@ lightMultiper: 0.899999976 mediumMultiper: 0.699999988 heavyMultiper: 0.5 + silhouettePlayer: 462 + silhouetteBag: 465 - Type: PickAndThrow Enabled: true throwForce: [10, 8, 10] @@ -2362,8 +2364,6 @@ delayTimer: 1 aimingLength: 1 throwItem: false - silhouettePlayer: 462 - silhouetteBag: 465 rayDistance: 0.75 rayHeight: 0.100000001 aimingFOV: 50 @@ -4782,7 +4782,7 @@ - Type: JumpPad Enabled: true - EID: 10 - Name: Canvas + Name: PauseCanvas IsActive: true NumberOfChildren: 3 Components: @@ -13297,4 +13297,51 @@ Mesh: 136373407 Material: 131956078 IsActive: true - Scripts: ~ \ No newline at end of file + Scripts: ~ +- EID: 174 + Name: TweenManager + IsActive: true + NumberOfChildren: 0 + Components: ~ + Scripts: + - Type: SHADE_Scripting.UI.TweenManager + Enabled: true +- EID: 172 + Name: StealFoodCanvas + IsActive: true + NumberOfChildren: 1 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 173 + 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: 172 + 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/Player/SC_PickAndThrow.cs b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs index 2de54025..1dcc0394 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs @@ -28,11 +28,6 @@ public class PickAndThrow : Script public bool throwItem = false; private Vector3 prevTargetOffSet; - public GameObject silhouettePlayer; - public Renderable silhouettePlayerRend; - public GameObject silhouetteBag; - public Renderable silhouetteBagRend; - [Tooltip("Lenght of ray")] public float rayDistance = 1; @@ -58,41 +53,17 @@ public class PickAndThrow : Script if(!tpc) Debug.LogError("TPC EMPTY"); - if(!silhouettePlayer) - Debug.LogError("silhouettePlayer EMPTY"); - else - silhouettePlayerRend = silhouettePlayer.GetComponent(); - - if (!silhouetteBag) - Debug.LogError("silhouetteBag EMPTY"); - else - silhouetteBagRend = silhouetteBag.GetComponent(); - AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw"); timer = delayTimer; } protected override void update() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || GameManager.Instance.stealFoodPopUp) { return; } - if (silhouettePlayerRend && silhouetteBagRend) - { - //wait for daniel - //0.00075f; - Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent().LocalPosition; - float disSqr = dis.GetSqrMagnitude(); - float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), 0, 1.0f); - float temp = (1 - ratio) * 0.00075f; - if (temp <= 0.0006f) - temp = 0.1f; - silhouettePlayerRend.Material.SetProperty("data.offset", temp); - silhouetteBagRend.Material.SetProperty("data.offset", temp); - } - if (timer <= delayTimer) timer += Time.DeltaTimeF; @@ -171,7 +142,7 @@ public class PickAndThrow : Script protected override void fixedUpdate() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || GameManager.Instance.stealFoodPopUp) { return; } diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 87e42032..917d1f98 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -17,15 +17,6 @@ public class PlayerController : Script TOTAL } -/* public enum WalkingState - { - CARRY, - AIMING, - THROW, - WALK, - TOTAL - }*/ - public RigidBody rb { get; set; } public Transform tranform { get; set; } public Camera cam { get; set; } @@ -85,6 +76,12 @@ public class PlayerController : Script [Tooltip("How heavy item will affect player jump")] public float heavyMultiper = 0.25f; + //silhouette===================================================================== + public GameObject silhouettePlayer; + public Renderable silhouettePlayerRend; + public GameObject silhouetteBag; + public Renderable silhouetteBagRend; + protected override void awake() { //default setup @@ -119,6 +116,21 @@ public class PlayerController : Script dictionary.Add(typeof(PlayerCaughtState), new PlayerCaughtState(stateMachine)); stateMachine.InitStateMachine(dictionary); + if (!silhouettePlayer) + Debug.LogError("silhouettePlayer EMPTY"); + else + { + silhouettePlayerRend = silhouettePlayer.GetComponent(); + silhouettePlayerRend.Material.SetProperty("data.offset", 0.1f); + } + + if (!silhouetteBag) + Debug.LogError("silhouetteBag EMPTY"); + else + { + silhouetteBagRend = silhouetteBag.GetComponent(); + silhouetteBagRend.Material.SetProperty("data.offset", 0.1f); + } } protected override void lateUpdate() @@ -127,26 +139,23 @@ public class PlayerController : Script protected override void update() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || GameManager.Instance.stealFoodPopUp) { return; } - if (delayTimer <= 1) - delayTimer += Time.DeltaTimeF; + if (silhouettePlayerRend && silhouetteBagRend) + { + Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent().LocalPosition; + float disSqr = dis.GetSqrMagnitude(); + float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), 0, 1.0f); + float temp = (1 - ratio) * 0.00075f; + if (temp <= 0.0006f) + temp = 0.1f; + silhouettePlayerRend.Material.SetProperty("data.offset", temp); + silhouetteBagRend.Material.SetProperty("data.offset", temp); + } - if (delayTimer < 1) - { - if (tranform && respawnPoint && rb) - { - rb.LinearVelocity = Vector3.Zero; - tranform.LocalPosition = respawnPoint.GetComponent().LocalPosition; - } - } - else - { - rb.FreezePositionY = false; - } //PickAndThrow check if (!pat) { @@ -160,9 +169,7 @@ public class PlayerController : Script if(!camArm) camArm = GetComponentInChildren(); - //tempFix - if (tranform) - tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f); + GotCaught(); Rotation(); @@ -178,7 +185,7 @@ public class PlayerController : Script protected override void fixedUpdate() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || GameManager.Instance.stealFoodPopUp) { return; } @@ -336,7 +343,7 @@ public class PlayerController : Script if (isMoveKeyPress && tranform && !isAiming) { Quaternion currentRotation = tranform.LocalRotation; - Quaternion targetRotation = Quaternion.LookRotation(new Vector3(axisMove.x, 0.0f, axisMove.y), new Vector3(0.0f, 1.0f, 0.0f)); + Quaternion targetRotation = Quaternion.LookRotation(new Vector3(axisMove.x, 0.0f, axisMove.y), Vector3.Up); tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime); } else if (camArm && tranform && isAiming) diff --git a/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs b/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs index b137609e..d135b32f 100644 --- a/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs +++ b/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs @@ -41,7 +41,7 @@ namespace SHADE_Scripting protected override void update() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || GameManager.Instance.stealFoodPopUp) { return; } diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index 1cebe002..fde9b753 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -40,6 +40,7 @@ public class GameManager : Script public static GameManager Instance { get; private set; } public bool GamePause { get; set; } + public bool stealFoodPopUp { get; set; } public bool itemShatter { get; set; } @@ -58,6 +59,8 @@ public class GameManager : Script currMultiplierDuration = 0; fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration); itemShatter = false; + GamePause = false; + stealFoodPopUp = true; AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win"); AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose"); diff --git a/Assets/Scripts/UI/SC_PauseMenu.cs b/Assets/Scripts/UI/SC_PauseMenu.cs index 521b48ea..6820e2d2 100644 --- a/Assets/Scripts/UI/SC_PauseMenu.cs +++ b/Assets/Scripts/UI/SC_PauseMenu.cs @@ -86,7 +86,7 @@ public class PauseMenu : Script protected override void update() { - if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause) + if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause && !GameManager.Instance.stealFoodPopUp) { GameManager.Instance.GamePause = true; AudioHandler.pauseAllSounds(true); diff --git a/Assets/Scripts/UI/SC_StealFoodPopUp.cs b/Assets/Scripts/UI/SC_StealFoodPopUp.cs index 59b97e7d..60bec589 100644 --- a/Assets/Scripts/UI/SC_StealFoodPopUp.cs +++ b/Assets/Scripts/UI/SC_StealFoodPopUp.cs @@ -79,6 +79,7 @@ namespace SHADE_Scripting.UI if (scaleOutX.IsCompleted() && scaleOutY.IsCompleted()) { GameObject.SetActive(false); + GameManager.Instance.stealFoodPopUp = false; } } }