From 660569601d3304e787b7e593a81058890613d4d9 Mon Sep 17 00:00:00 2001 From: Novvator Date: Mon, 8 Mar 2021 14:16:20 +0000 Subject: [PATCH 1/4] first implementation of freeze --- .../ArtefactObjects/Power/PA_Freeze.asset | 18 ++++++++ .../Power/PA_Freeze.asset.meta | 8 ++++ game/Assets/Scenes/Main.unity | 45 ++++++++++++++----- .../Assets/Scripts/Artefacts/PickUpDisplay.cs | 17 ++++--- .../Assets/Scripts/Player/PlayerController.cs | 19 +++++++- .../Scripts/Player/PlayerInputHandler.cs | 27 ++++++++--- .../Scripts/Player/PlayerInputSettings.cs | 4 ++ game/Assets/Scripts/Player/PlayerPowers.cs | 8 ++++ .../Input/PlayerControls.inputactions | 19 ++++++++ .../Settings/Player/PlayerInputSettings.asset | 1 + .../Settings/Player/Powers/Freeze.asset | 17 +++++++ .../Settings/Player/Powers/Freeze.asset.meta | 8 ++++ .../Player/Powers/playerTimeScale.asset | 16 +++++++ .../Player/Powers/playerTimeScale.asset.meta | 8 ++++ 14 files changed, 188 insertions(+), 27 deletions(-) create mode 100644 game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset create mode 100644 game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset.meta create mode 100644 game/Assets/Settings/Player/Powers/Freeze.asset create mode 100644 game/Assets/Settings/Player/Powers/Freeze.asset.meta create mode 100644 game/Assets/Settings/Player/Powers/playerTimeScale.asset create mode 100644 game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta diff --git a/game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset b/game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset new file mode 100644 index 0000000..82e4056 --- /dev/null +++ b/game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset @@ -0,0 +1,18 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0228856d50ce2a845abd7b3eda114390, type: 3} + m_Name: PA_Freeze + m_EditorClassIdentifier: + _artefactID: 12 + _dialogueKey: + _name: Freeze + _power: {fileID: 0} diff --git a/game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset.meta b/game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset.meta new file mode 100644 index 0000000..067ac7e --- /dev/null +++ b/game/Assets/Data/Artefacts/ArtefactObjects/Power/PA_Freeze.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2e37ff6639a22e4eacc5e95d8e13723 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/Scenes/Main.unity b/game/Assets/Scenes/Main.unity index f9d2d8a..5fd82a7 100644 --- a/game/Assets/Scenes/Main.unity +++ b/game/Assets/Scenes/Main.unity @@ -2538,11 +2538,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264403 + value: -0.017264389 objectReference: {fileID: 0} - target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297725 + value: 0.009297717 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalPosition.x @@ -2558,19 +2558,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.9680315 + value: 0.9663801 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.24655113 + value: 0.24613053 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.044697862 + value: 0.07205816 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.011384245 + value: -0.018352732 objectReference: {fileID: 0} - target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_Name @@ -2624,6 +2624,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4676633831598614294, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _freeze + value: + objectReference: {fileID: 11400000, guid: 0cd9cf6494bb6f54d9b97631010d780e, type: 2} - target: {fileID: 4676633831598614294, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: _cheatBlink value: 0 @@ -2632,6 +2636,22 @@ PrefabInstance: propertyPath: _cheatBoost value: 0 objectReference: {fileID: 0} + - target: {fileID: 4676633831598614294, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _cheatFreeze + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_DefaultControlScheme + value: PCMR + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: playerTimeScale + value: + objectReference: {fileID: 11400000, guid: 39c05ba9d0743074b9eb0e561ba1fcb8, type: 2} + - target: {fileID: 4676633831945762667, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: playerTimeScale + value: + objectReference: {fileID: 11400000, guid: 39c05ba9d0743074b9eb0e561ba1fcb8, type: 2} - target: {fileID: 4676633831945762708, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_Height value: 1.5 @@ -2662,11 +2682,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264403 + value: -0.017264389 objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297725 + value: 0.009297717 objectReference: {fileID: 0} - target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_XAxis.m_InvertInput @@ -2702,19 +2722,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.9996367 + value: 0.9984866 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.0047711134 + value: 0.0047656302 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.023356276 + value: 0.048239034 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.0125784995 + value: -0.02597908 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} @@ -7364,6 +7384,7 @@ MonoBehaviour: inputSettings: {fileID: 11400000, guid: 87faf39b6f22e524984c1680a88045ac, type: 2} dialogue: {fileID: 11400000, guid: 56369c4e83cc59e44bf55cd16fafc4e8, type: 2} artefacts: {fileID: 11400000, guid: f523ac0d77530064b8b41c627b13fae0, type: 2} + playerTimeScale: {fileID: 11400000, guid: 39c05ba9d0743074b9eb0e561ba1fcb8, type: 2} --- !u!114 &2070784759 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/game/Assets/Scripts/Artefacts/PickUpDisplay.cs b/game/Assets/Scripts/Artefacts/PickUpDisplay.cs index 34781be..c0271ab 100644 --- a/game/Assets/Scripts/Artefacts/PickUpDisplay.cs +++ b/game/Assets/Scripts/Artefacts/PickUpDisplay.cs @@ -16,6 +16,7 @@ public class PickUpDisplay : MonoBehaviour [SerializeField] private InputSettings inputSettings; [SerializeField] private DialogueSystem dialogue; [SerializeField] private ArtefactSystem artefacts; + [SerializeField] private SerialFloat playerTimeScale; private Artefact chosenArtefact; @@ -35,22 +36,24 @@ public class PickUpDisplay : MonoBehaviour public void PopUpOn() { _paused = true; - artefactUI.SetActive(true); - Player.GetComponent().enabled = false; + //artefactUI.SetActive(true); + //Player.GetComponent().enabled = false; artefactText.text = "You have unlocked " + chosenArtefact.Name + "!"; - inputSettings.updateMode = (InputSettings.UpdateMode)1; + //inputSettings.updateMode = (InputSettings.UpdateMode)1; Time.timeScale = 0f; + //playerTimeScale.Value = 0f; } public void PopUpOff() { _paused = false; - artefactUI.SetActive(false); - inputSettings.updateMode = (InputSettings.UpdateMode)2; - Player.GetComponent().enabled = true; + //artefactUI.SetActive(false); + //inputSettings.updateMode = (InputSettings.UpdateMode)2; + //Player.GetComponent().enabled = true; Time.timeScale = 1.0f; + //playerTimeScale.Value = 1.0f; - dialogue.PlayLine(chosenArtefact.dialogueKey); + //dialogue.PlayLine(chosenArtefact.dialogueKey); chosenArtefact = null; } } diff --git a/game/Assets/Scripts/Player/PlayerController.cs b/game/Assets/Scripts/Player/PlayerController.cs index c62724e..eeff8a6 100644 --- a/game/Assets/Scripts/Player/PlayerController.cs +++ b/game/Assets/Scripts/Player/PlayerController.cs @@ -1,6 +1,7 @@ using Extensions; using UnityEngine; using NaughtyAttributes; +using Ktyl.Util; public class PlayerController : MonoBehaviour { @@ -68,6 +69,10 @@ public class PlayerController : MonoBehaviour private const float TAU = Mathf.PI * 2f; private const float HALF_PI = Mathf.PI / 2f; + + [SerializeField] + private SerialFloat playerTimeScale; + private enum JumpState { None, @@ -149,6 +154,17 @@ public class PlayerController : MonoBehaviour } } + + /*private void UpdateFreeze( float dt) + { + if( _powers.Freeze.CanConsume ) + { + Time.timeScale = 0f; + _powers.Freeze.Consume(); + } + } + */ + private void UpdateJump(float dt) { _fallTime = _grounded ? 0f : (_fallTime + dt); @@ -257,7 +273,7 @@ public class PlayerController : MonoBehaviour private void FixedUpdate() { - float dt = Time.fixedDeltaTime; + float dt = Time.fixedUnscaledDeltaTime * playerTimeScale; _overrideDelta = Vector2.zero; @@ -273,6 +289,7 @@ public class PlayerController : MonoBehaviour UpdateJump( dt ); UpdateLook( dt ); UpdateBlink( dt ); + //UpdateFreeze( dt ); UpdateGravity( dt ); UpdateDrag( dt ); UpdateMovement( dt ); diff --git a/game/Assets/Scripts/Player/PlayerInputHandler.cs b/game/Assets/Scripts/Player/PlayerInputHandler.cs index e844d6f..ee112d7 100644 --- a/game/Assets/Scripts/Player/PlayerInputHandler.cs +++ b/game/Assets/Scripts/Player/PlayerInputHandler.cs @@ -16,20 +16,25 @@ public class PlayerInputHandler : MonoBehaviour [SerializeField] private Camera _camera; + [SerializeField] + private SerialFloat playerTimeScale; + public class PlayerInputState { public BufferedInput Jump; public BufferedInput Blink; public BufferedInput Use; + public BufferedInput Freeze; public CameraRelativeInput Move; public Vector2 Look; public float MoveRotation; - public PlayerInputState( float jumpBuffer, float blinkBuffer, float useBuffer ) + public PlayerInputState( float jumpBuffer, float blinkBuffer, float useBuffer , float freezeBuffer) { Jump = new BufferedInput( jumpBuffer ); Blink = new BufferedInput( blinkBuffer ); Use = new BufferedInput( useBuffer ); + Freeze = new BufferedInput( freezeBuffer ); Move = new CameraRelativeInput(); Look = Vector2.zero; } @@ -39,6 +44,7 @@ public class PlayerInputHandler : MonoBehaviour Jump.Update(deltaTime); Blink.Update(deltaTime); Use.Update(deltaTime); + Freeze.Update(deltaTime); } } @@ -48,16 +54,17 @@ public class PlayerInputHandler : MonoBehaviour private void Awake() { - _state = new PlayerInputState( - _inputSettings.JumpBufferTime, - _inputSettings.BlinkBufferTime, - _inputSettings.UseBufferTime - ); + _state = new PlayerInputState( + _inputSettings.JumpBufferTime, + _inputSettings.BlinkBufferTime, + _inputSettings.UseBufferTime, + _inputSettings.FreezeBufferTime + ) ; } private void FixedUpdate() { - _state.Update( Time.fixedDeltaTime ); + _state.Update( Time.fixedDeltaTime); float cameraRotation = _camera.transform.rotation.eulerAngles.y; _state.Move.SetAngle(-cameraRotation); @@ -85,4 +92,10 @@ public class PlayerInputHandler : MonoBehaviour if(context.started) EventHandler.current.ArtefactPickUp(_nearbyArtefactID.Value); } + + public void Freeze(InputAction.CallbackContext context) + { + _state.Freeze.Set( context.ReadValueAsButton() ); + + } } \ No newline at end of file diff --git a/game/Assets/Scripts/Player/PlayerInputSettings.cs b/game/Assets/Scripts/Player/PlayerInputSettings.cs index 68f8415..d3409f6 100644 --- a/game/Assets/Scripts/Player/PlayerInputSettings.cs +++ b/game/Assets/Scripts/Player/PlayerInputSettings.cs @@ -8,6 +8,7 @@ public class PlayerInputSettings : ScriptableObject public float JumpBufferTime => _jumpBufferTime; public float BlinkBufferTime => _blinkBufferTime; public float UseBufferTime => _useBufferTime; + public float FreezeBufferTime => _freezeBufferTime; [SerializeField] private float _jumpBufferTime; @@ -17,4 +18,7 @@ public class PlayerInputSettings : ScriptableObject [SerializeField] private float _useBufferTime; + + [SerializeField] + private float _freezeBufferTime; } diff --git a/game/Assets/Scripts/Player/PlayerPowers.cs b/game/Assets/Scripts/Player/PlayerPowers.cs index 8ddb7fa..d222841 100644 --- a/game/Assets/Scripts/Player/PlayerPowers.cs +++ b/game/Assets/Scripts/Player/PlayerPowers.cs @@ -12,6 +12,9 @@ public class PlayerPowers : MonoBehaviour [SerializeField] private bool _cheatBoost; + [SerializeField] + private bool _cheatFreeze; + [Header( "References" )] [SerializeField] private PlayerPower _blink; @@ -19,12 +22,17 @@ public class PlayerPowers : MonoBehaviour [SerializeField] private PlayerPower _boost; + [SerializeField] + private PlayerPower _freeze; + public PlayerPower Blink => _blink; public PlayerPower Boost => _boost; + public PlayerPower Freeze => _freeze; public void UpdatePowers( float dt, bool grounded ) { _blink.UpdatePower( dt, _cheatBlink, grounded ); _boost.UpdatePower( dt, _cheatBoost, grounded ); + _boost.UpdatePower(dt, _cheatFreeze, grounded); } } \ No newline at end of file diff --git a/game/Assets/Settings/Input/PlayerControls.inputactions b/game/Assets/Settings/Input/PlayerControls.inputactions index ffae4f3..657e6cb 100644 --- a/game/Assets/Settings/Input/PlayerControls.inputactions +++ b/game/Assets/Settings/Input/PlayerControls.inputactions @@ -44,6 +44,14 @@ "expectedControlType": "Button", "processors": "", "interactions": "" + }, + { + "name": "Freeze", + "type": "Button", + "id": "29f1599e-fe43-47df-ad25-8e712263d0ab", + "expectedControlType": "Button", + "processors": "", + "interactions": "" } ], "bindings": [ @@ -200,6 +208,17 @@ "action": "Blink", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "8c9e09a3-477e-4760-bdba-f81beaec4988", + "path": "/g", + "interactions": "", + "processors": "", + "groups": "PCMR", + "action": "Freeze", + "isComposite": false, + "isPartOfComposite": false } ] } diff --git a/game/Assets/Settings/Player/PlayerInputSettings.asset b/game/Assets/Settings/Player/PlayerInputSettings.asset index 6ae14f2..1aeb4d5 100644 --- a/game/Assets/Settings/Player/PlayerInputSettings.asset +++ b/game/Assets/Settings/Player/PlayerInputSettings.asset @@ -15,3 +15,4 @@ MonoBehaviour: _jumpBufferTime: 0.1 _blinkBufferTime: 0.1 _useBufferTime: 0.1 + _freezeBufferTime: 2 diff --git a/game/Assets/Settings/Player/Powers/Freeze.asset b/game/Assets/Settings/Player/Powers/Freeze.asset new file mode 100644 index 0000000..2c64d89 --- /dev/null +++ b/game/Assets/Settings/Player/Powers/Freeze.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24d28ac60e22b5547b2beb8679625039, type: 3} + m_Name: Freeze + m_EditorClassIdentifier: + _regenerateOnGround: 0 + _regenerateInAir: 0 + _regenerateTime: 0 diff --git a/game/Assets/Settings/Player/Powers/Freeze.asset.meta b/game/Assets/Settings/Player/Powers/Freeze.asset.meta new file mode 100644 index 0000000..7b81e61 --- /dev/null +++ b/game/Assets/Settings/Player/Powers/Freeze.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0cd9cf6494bb6f54d9b97631010d780e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/Settings/Player/Powers/playerTimeScale.asset b/game/Assets/Settings/Player/Powers/playerTimeScale.asset new file mode 100644 index 0000000..b3d57a4 --- /dev/null +++ b/game/Assets/Settings/Player/Powers/playerTimeScale.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76553ada4233edc458c3fed9b69e128f, type: 3} + m_Name: playerTimeScale + m_EditorClassIdentifier: + _initialValue: 1 + _readOnly: 0 diff --git a/game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta b/game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta new file mode 100644 index 0000000..ed4d209 --- /dev/null +++ b/game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39c05ba9d0743074b9eb0e561ba1fcb8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 4c689e05618801a5cebb908e33cdf978ef24bfa6 Mon Sep 17 00:00:00 2001 From: cyndrdev Date: Tue, 9 Mar 2021 14:24:31 +0000 Subject: [PATCH 2/4] minor bugfixes --- game/Assets/Prefabs/Player.prefab | 20 +++++ game/Assets/Prefabs/PlayerObjects.prefab | 16 ++++ game/Assets/Scenes/Main.unity | 75 ++++++++++++++++--- game/Assets/Scripts/Player/PlayerPowers.cs | 2 +- .../Input/PlayerControls.inputactions | 11 +++ 5 files changed, 113 insertions(+), 11 deletions(-) diff --git a/game/Assets/Prefabs/Player.prefab b/game/Assets/Prefabs/Player.prefab index 8fd3555..e67ca8c 100644 --- a/game/Assets/Prefabs/Player.prefab +++ b/game/Assets/Prefabs/Player.prefab @@ -163,6 +163,7 @@ MonoBehaviour: _jumpColor: {r: 1, g: 0.95084643, b: 0, a: 0} _boostColor: {r: 1, g: 0, b: 0.9173207, a: 0} _exhaustedColor: {r: 1, g: 0, b: 0, a: 0} + playerTimeScale: {fileID: 0} --- !u!114 &13726836969441780 MonoBehaviour: m_ObjectHideFlags: 0 @@ -268,6 +269,22 @@ MonoBehaviour: m_CallState: 2 m_ActionId: 0eb55067-1328-4b0a-9494-b427befe049a m_ActionName: CoreMap/New action + - m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 13726836969441782} + m_TargetAssemblyTypeName: PlayerInputHandler, Assembly-CSharp + m_MethodName: Freeze + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_ActionId: 29f1599e-fe43-47df-ad25-8e712263d0ab + m_ActionName: CoreMap/Freeze[/Keyboard/g] m_NeverAutoSwitchControlSchemes: 1 m_DefaultControlScheme: Gamepad m_DefaultActionMap: CoreMap @@ -288,6 +305,7 @@ MonoBehaviour: _nearbyArtefactID: {fileID: 11400000, guid: caba70196fbb1c549a934f7566f7a247, type: 2} _inputSettings: {fileID: 11400000, guid: 09b165d6ce14f86459be7213da9688a7, type: 2} _camera: {fileID: 0} + playerTimeScale: {fileID: 0} --- !u!114 &13726837176080779 MonoBehaviour: m_ObjectHideFlags: 0 @@ -302,8 +320,10 @@ MonoBehaviour: m_EditorClassIdentifier: _cheatBlink: 1 _cheatBoost: 1 + _cheatFreeze: 0 _blink: {fileID: 11400000, guid: b47ea197a7cc2ed4eb15271cef672997, type: 2} _boost: {fileID: 11400000, guid: d5ed942937d8cca478f3ec97f6b9c8a2, type: 2} + _freeze: {fileID: 0} --- !u!114 &3320306143821152633 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/game/Assets/Prefabs/PlayerObjects.prefab b/game/Assets/Prefabs/PlayerObjects.prefab index f8daec2..2698468 100644 --- a/game/Assets/Prefabs/PlayerObjects.prefab +++ b/game/Assets/Prefabs/PlayerObjects.prefab @@ -242,6 +242,18 @@ PrefabInstance: propertyPath: m_Camera value: objectReference: {fileID: 4676633831388223340} + - target: {fileID: 13726836969441780, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_ActionId + value: 0eb55067-1328-4b0a-9494-b427befe049a + objectReference: {fileID: 0} + - target: {fileID: 13726836969441780, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_ActionName + value: CoreMap/New action + objectReference: {fileID: 0} + - target: {fileID: 13726836969441780, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: Blink + objectReference: {fileID: 0} - target: {fileID: 13726836969441781, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} propertyPath: m_Name value: Player @@ -250,6 +262,10 @@ PrefabInstance: propertyPath: _camera value: objectReference: {fileID: 4676633831388223340} + - target: {fileID: 13726837176080779, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} + propertyPath: _freeze + value: + objectReference: {fileID: 11400000, guid: 0cd9cf6494bb6f54d9b97631010d780e, type: 2} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} --- !u!4 &4676633831945762709 stripped diff --git a/game/Assets/Scenes/Main.unity b/game/Assets/Scenes/Main.unity index 5fd82a7..f234d6c 100644 --- a/game/Assets/Scenes/Main.unity +++ b/game/Assets/Scenes/Main.unity @@ -2544,6 +2544,10 @@ PrefabInstance: propertyPath: m_LocalRotation.z value: 0.009297717 objectReference: {fileID: 0} + - target: {fileID: 4676633831388223329, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_IgnoreTimeScale + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -2558,19 +2562,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.9663801 + value: 0.9680315 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.24613053 + value: 0.24655113 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.07205816 + value: 0.044697873 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.018352732 + value: -0.011384248 objectReference: {fileID: 0} - target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_Name @@ -2644,6 +2648,46 @@ PrefabInstance: propertyPath: m_DefaultControlScheme value: PCMR objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.size + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_ActionId + value: 29f1599e-fe43-47df-ad25-8e712263d0ab + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_ActionName + value: CoreMap/Freeze[/Keyboard/g] + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 1239556280} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: Freeze + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: PlayerInputHandler, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762665, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: playerTimeScale value: @@ -2682,11 +2726,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264389 + value: -0.017264403 objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297717 + value: 0.009297725 objectReference: {fileID: 0} - target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_XAxis.m_InvertInput @@ -2722,19 +2766,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.9984866 + value: 0.9996367 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.0047656302 + value: 0.0047710985 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.048239034 + value: 0.023356276 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.02597908 + value: -0.012578499 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} @@ -4426,6 +4470,17 @@ GameObject: m_CorrespondingSourceObject: {fileID: 4676633831945762664, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} m_PrefabInstance: {fileID: 782933553} m_PrefabAsset: {fileID: 0} +--- !u!114 &1239556280 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4676633831945762667, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + m_PrefabInstance: {fileID: 782933553} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239556274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e12816fc78a8ca3429be019aa4e51fdd, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1241011629 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 803c82d4ce9f809448a55cba1adec183, type: 3} diff --git a/game/Assets/Scripts/Player/PlayerPowers.cs b/game/Assets/Scripts/Player/PlayerPowers.cs index d222841..a1a9ae1 100644 --- a/game/Assets/Scripts/Player/PlayerPowers.cs +++ b/game/Assets/Scripts/Player/PlayerPowers.cs @@ -33,6 +33,6 @@ public class PlayerPowers : MonoBehaviour { _blink.UpdatePower( dt, _cheatBlink, grounded ); _boost.UpdatePower( dt, _cheatBoost, grounded ); - _boost.UpdatePower(dt, _cheatFreeze, grounded); + _freeze.UpdatePower(dt, _cheatFreeze, grounded); } } \ No newline at end of file diff --git a/game/Assets/Settings/Input/PlayerControls.inputactions b/game/Assets/Settings/Input/PlayerControls.inputactions index 657e6cb..75207c6 100644 --- a/game/Assets/Settings/Input/PlayerControls.inputactions +++ b/game/Assets/Settings/Input/PlayerControls.inputactions @@ -219,6 +219,17 @@ "action": "Freeze", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "6774e0ae-b8a1-4146-b779-01bbab6de14b", + "path": "/buttonEast", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Freeze", + "isComposite": false, + "isPartOfComposite": false } ] } From 873c0908efe4189995139f16bcd2f90c10cad48a Mon Sep 17 00:00:00 2001 From: Novvator Date: Sat, 13 Mar 2021 02:01:20 +0000 Subject: [PATCH 3/4] power freeze now works + UI indicator --- game/Assets/Scenes/Main.unity | 361 +++++++++++++++++- .../Assets/Scripts/Artefacts/PickUpDisplay.cs | 19 +- .../Assets/Scripts/Player/PlayerController.cs | 55 ++- .../Scripts/Player/PlayerInputHandler.cs | 3 - game/Assets/Scripts/Player/PlayerPower.cs | 22 +- game/Assets/Scripts/Traps/FallawayFloor.cs | 25 +- .../Traps/objectTimeScale.asset} | 2 +- .../Traps/objectTimeScale.asset.meta} | 2 +- game/Assets/Scripts/UI/PlayerUI.cs | 23 ++ game/Assets/Scripts/UI/PlayerUI.cs.meta | 11 + .../Settings/Player/Powers/Freeze.asset | 7 +- game/Assets/UI/PlayerUI.meta | 8 + game/Assets/UI/PlayerUI/Cooldown.meta | 8 + .../Assets/UI/PlayerUI/Cooldown/3702524 1.jpg | 3 + .../UI/PlayerUI/Cooldown/3702524 1.jpg.meta | 144 +++++++ ...rawing-isolated-illustration-177176959.jpg | 3 + ...g-isolated-illustration-177176959.jpg.meta | 144 +++++++ 17 files changed, 789 insertions(+), 51 deletions(-) rename game/Assets/{Settings/Player/Powers/playerTimeScale.asset => Scripts/Traps/objectTimeScale.asset} (94%) rename game/Assets/{Settings/Player/Powers/playerTimeScale.asset.meta => Scripts/Traps/objectTimeScale.asset.meta} (79%) create mode 100644 game/Assets/Scripts/UI/PlayerUI.cs create mode 100644 game/Assets/Scripts/UI/PlayerUI.cs.meta create mode 100644 game/Assets/UI/PlayerUI.meta create mode 100644 game/Assets/UI/PlayerUI/Cooldown.meta create mode 100644 game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg create mode 100644 game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg.meta create mode 100644 game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg create mode 100644 game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg.meta diff --git a/game/Assets/Scenes/Main.unity b/game/Assets/Scenes/Main.unity index f234d6c..1257149 100644 --- a/game/Assets/Scenes/Main.unity +++ b/game/Assets/Scenes/Main.unity @@ -993,6 +993,10 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 1571618361} m_Modifications: + - target: {fileID: 980120856895548939, guid: d145f0e5906f91a4fad7f384f1b2a6ec, type: 3} + propertyPath: objectTimeScale + value: + objectReference: {fileID: 11400000, guid: 9b68e167db44c0c42837e9a679da964e, type: 2} - target: {fileID: 8144920974147422729, guid: d145f0e5906f91a4fad7f384f1b2a6ec, type: 3} propertyPath: m_RootOrder value: 0 @@ -1166,6 +1170,81 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674079097563415} m_PrefabAsset: {fileID: 0} +--- !u!1 &355438498 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 355438499} + - component: {fileID: 355438501} + - component: {fileID: 355438500} + m_Layer: 5 + m_Name: Cooldown + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &355438499 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355438498} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1864962002} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -50, y: -50} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &355438500 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355438498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: a11777191ca1ac140accf07b15900e79, type: 3} + m_Type: 3 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &355438501 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355438498} + m_CullTransparentMesh: 1 --- !u!4 &359635900 stripped Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} @@ -1226,6 +1305,82 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 584f9522dd055c543863c0c60d13776e, type: 3} m_PrefabInstance: {fileID: 3060674077788289208} m_PrefabAsset: {fileID: 0} +--- !u!1 &399809200 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 399809201} + - component: {fileID: 399809203} + - component: {fileID: 399809202} + m_Layer: 5 + m_Name: PlayerUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &399809201 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 399809200} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1864962002} + m_Father: {fileID: 2070784762} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &399809202 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 399809200} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &399809203 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 399809200} + m_CullTransparentMesh: 1 --- !u!1 &400420174 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} @@ -1284,6 +1439,81 @@ GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674077675415875} m_PrefabAsset: {fileID: 0} +--- !u!1 &435646862 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 435646863} + - component: {fileID: 435646865} + - component: {fileID: 435646864} + m_Layer: 5 + m_Name: FreezePanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &435646863 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 435646862} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2070784762} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &435646864 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 435646862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0.16378963, b: 0.2264151, a: 0.392} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &435646865 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 435646862} + m_CullTransparentMesh: 1 --- !u!4 &437846307 stripped Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 2784d88b6334dc143a910f3d252aa5df, type: 3} @@ -1489,7 +1719,7 @@ RectTransform: - {fileID: 1361646744} - {fileID: 59318656} m_Father: {fileID: 2070784762} - m_RootOrder: 0 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -2538,11 +2768,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264389 + value: -0.017264403 objectReference: {fileID: 0} - target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297717 + value: 0.009297725 objectReference: {fileID: 0} - target: {fileID: 4676633831388223329, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_IgnoreTimeScale @@ -2562,19 +2792,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.9680315 + value: 0.96638465 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.24655113 + value: 0.24613166 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.044697873 + value: 0.07199832 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.011384248 + value: -0.018337488 objectReference: {fileID: 0} - target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_Name @@ -2688,6 +2918,22 @@ PrefabInstance: propertyPath: m_ActionEvents.Array.data[5].m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName value: UnityEngine.Object, UnityEngine objectReference: {fileID: 0} + - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: frozenTime + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: FreezePanel + value: + objectReference: {fileID: 435646862} + - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: cooldownImage + value: + objectReference: {fileID: 355438500} + - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: objectTimeScale + value: + objectReference: {fileID: 11400000, guid: 9b68e167db44c0c42837e9a679da964e, type: 2} - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: playerTimeScale value: @@ -2726,11 +2972,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264403 + value: -0.017264389 objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297725 + value: 0.009297717 objectReference: {fileID: 0} - target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_XAxis.m_InvertInput @@ -2766,19 +3012,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.9996367 + value: 0.99849 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.0047710985 + value: 0.0047656447 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.023356276 + value: 0.048184585 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.012578499 + value: -0.025949758 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} @@ -3374,7 +3620,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5119468870989674483, guid: fde30a46065b3b144ac612ec0b3e484a, type: 3} propertyPath: m_RootOrder - value: 1 + value: 4 objectReference: {fileID: 0} - target: {fileID: 5119468870989674483, guid: fde30a46065b3b144ac612ec0b3e484a, type: 3} propertyPath: m_AnchorMax.x @@ -4837,7 +5083,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8951021900398560347, guid: 8b2275700cf2cc5448873b7f1aa592b6, type: 3} propertyPath: m_RootOrder - value: 2 + value: 3 objectReference: {fileID: 0} - target: {fileID: 8951021900398560347, guid: 8b2275700cf2cc5448873b7f1aa592b6, type: 3} propertyPath: m_AnchorMax.x @@ -5479,6 +5725,10 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 1571618361} m_Modifications: + - target: {fileID: 980120856895548939, guid: d145f0e5906f91a4fad7f384f1b2a6ec, type: 3} + propertyPath: objectTimeScale + value: + objectReference: {fileID: 11400000, guid: 9b68e167db44c0c42837e9a679da964e, type: 2} - target: {fileID: 8144920974147422729, guid: d145f0e5906f91a4fad7f384f1b2a6ec, type: 3} propertyPath: m_RootOrder value: 1 @@ -6818,6 +7068,82 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674077618818203} m_PrefabAsset: {fileID: 0} +--- !u!1 &1864962001 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1864962002} + - component: {fileID: 1864962004} + - component: {fileID: 1864962003} + m_Layer: 5 + m_Name: Hourglass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1864962002 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864962001} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 355438499} + m_Father: {fileID: 399809201} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -80, y: -78} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1864962003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864962001} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: aaef6bac05ac36e48ade031f9a4230be, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1864962004 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864962001} + m_CullTransparentMesh: 1 --- !u!1 &1865590810 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 4a31c57c3ca869448a5849436b526efa, type: 3} @@ -7439,7 +7765,6 @@ MonoBehaviour: inputSettings: {fileID: 11400000, guid: 87faf39b6f22e524984c1680a88045ac, type: 2} dialogue: {fileID: 11400000, guid: 56369c4e83cc59e44bf55cd16fafc4e8, type: 2} artefacts: {fileID: 11400000, guid: f523ac0d77530064b8b41c627b13fae0, type: 2} - playerTimeScale: {fileID: 11400000, guid: 39c05ba9d0743074b9eb0e561ba1fcb8, type: 2} --- !u!114 &2070784759 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7512,9 +7837,11 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: + - {fileID: 435646863} + - {fileID: 399809201} - {fileID: 483749938} - - {fileID: 982982466} - {fileID: 1356834191} + - {fileID: 982982466} m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/game/Assets/Scripts/Artefacts/PickUpDisplay.cs b/game/Assets/Scripts/Artefacts/PickUpDisplay.cs index c0271ab..d31aa28 100644 --- a/game/Assets/Scripts/Artefacts/PickUpDisplay.cs +++ b/game/Assets/Scripts/Artefacts/PickUpDisplay.cs @@ -16,7 +16,6 @@ public class PickUpDisplay : MonoBehaviour [SerializeField] private InputSettings inputSettings; [SerializeField] private DialogueSystem dialogue; [SerializeField] private ArtefactSystem artefacts; - [SerializeField] private SerialFloat playerTimeScale; private Artefact chosenArtefact; @@ -36,24 +35,22 @@ public class PickUpDisplay : MonoBehaviour public void PopUpOn() { _paused = true; - //artefactUI.SetActive(true); - //Player.GetComponent().enabled = false; + artefactUI.SetActive(true); + Player.GetComponent().enabled = false; artefactText.text = "You have unlocked " + chosenArtefact.Name + "!"; - //inputSettings.updateMode = (InputSettings.UpdateMode)1; + inputSettings.updateMode = (InputSettings.UpdateMode)1; Time.timeScale = 0f; - //playerTimeScale.Value = 0f; } public void PopUpOff() { _paused = false; - //artefactUI.SetActive(false); - //inputSettings.updateMode = (InputSettings.UpdateMode)2; - //Player.GetComponent().enabled = true; + artefactUI.SetActive(false); + inputSettings.updateMode = (InputSettings.UpdateMode)2; + Player.GetComponent().enabled = true; Time.timeScale = 1.0f; - //playerTimeScale.Value = 1.0f; - - //dialogue.PlayLine(chosenArtefact.dialogueKey); + + dialogue.PlayLine(chosenArtefact.dialogueKey); chosenArtefact = null; } } diff --git a/game/Assets/Scripts/Player/PlayerController.cs b/game/Assets/Scripts/Player/PlayerController.cs index eeff8a6..81e81d7 100644 --- a/game/Assets/Scripts/Player/PlayerController.cs +++ b/game/Assets/Scripts/Player/PlayerController.cs @@ -2,6 +2,8 @@ using Extensions; using UnityEngine; using NaughtyAttributes; using Ktyl.Util; +using System.Collections; +using UnityEngine.UI; public class PlayerController : MonoBehaviour { @@ -69,9 +71,22 @@ public class PlayerController : MonoBehaviour private const float TAU = Mathf.PI * 2f; private const float HALF_PI = Mathf.PI / 2f; + private float timeSinceStop; + + [Header("Power Freeze")] + [SerializeField] + private SerialFloat objectTimeScale; [SerializeField] - private SerialFloat playerTimeScale; + private float frozenTime; + + [SerializeField] + private GameObject FreezePanel; + + [SerializeField] + private Image cooldownImage; + + private float cooldownTimer = 0f; private enum JumpState { @@ -155,15 +170,41 @@ public class PlayerController : MonoBehaviour } - /*private void UpdateFreeze( float dt) + private void UpdateFreeze( float dt) { - if( _powers.Freeze.CanConsume ) + updateCooldownUI(_powers.Freeze.cooldown, _powers.Freeze.regenerateTime); + if ( _powers.Freeze.CanConsume && _inputHandler.InputState.Freeze.GetRawValue() ) { - Time.timeScale = 0f; _powers.Freeze.Consume(); + objectTimeScale.Value = 0f; + FreezePanel.SetActive(true); } + + if (_powers.Freeze.timeSinceConsume > frozenTime) + { + UnfreezeTime(); + } + } - */ + + private void UnfreezeTime() + { + FreezePanel.SetActive(false); + objectTimeScale.Value = 1f; + } + + + + public void updateCooldownUI(float rawCooldownTimer, float regenerateTime) + { + if (rawCooldownTimer <= 0) + cooldownTimer = 0; + else + cooldownTimer = rawCooldownTimer / regenerateTime; + + cooldownImage.fillAmount = cooldownTimer; + } + private void UpdateJump(float dt) { @@ -273,7 +314,7 @@ public class PlayerController : MonoBehaviour private void FixedUpdate() { - float dt = Time.fixedUnscaledDeltaTime * playerTimeScale; + float dt = Time.fixedDeltaTime; _overrideDelta = Vector2.zero; @@ -289,7 +330,7 @@ public class PlayerController : MonoBehaviour UpdateJump( dt ); UpdateLook( dt ); UpdateBlink( dt ); - //UpdateFreeze( dt ); + UpdateFreeze( dt ); UpdateGravity( dt ); UpdateDrag( dt ); UpdateMovement( dt ); diff --git a/game/Assets/Scripts/Player/PlayerInputHandler.cs b/game/Assets/Scripts/Player/PlayerInputHandler.cs index ee112d7..12000f4 100644 --- a/game/Assets/Scripts/Player/PlayerInputHandler.cs +++ b/game/Assets/Scripts/Player/PlayerInputHandler.cs @@ -16,9 +16,6 @@ public class PlayerInputHandler : MonoBehaviour [SerializeField] private Camera _camera; - [SerializeField] - private SerialFloat playerTimeScale; - public class PlayerInputState { public BufferedInput Jump; diff --git a/game/Assets/Scripts/Player/PlayerPower.cs b/game/Assets/Scripts/Player/PlayerPower.cs index 92fe77f..6321104 100644 --- a/game/Assets/Scripts/Player/PlayerPower.cs +++ b/game/Assets/Scripts/Player/PlayerPower.cs @@ -7,26 +7,34 @@ using UnityEngine.Events; [CreateAssetMenu(menuName = "KernelPanic/Player/Power", fileName = "PlayerPower.asset")] public class PlayerPower : ScriptableObject { + + [SerializeField] private bool _regenerateOnGround; [SerializeField] private bool _regenerateInAir; - - [SerializeField] - private float _regenerateTime; + + + public float regenerateTime => _regenerateTime; + [SerializeField] private float _regenerateTime; private bool _unlocked; private bool _cheated; private bool _consumed; - - private float _timeSinceConsume; + + public float cooldown => _cooldown; + private float _cooldown; + + public float timeSinceConsume => _timeSinceConsume; + public float _timeSinceConsume; private UnityEvent _onUnlock = new UnityEvent(); public UnityEvent OnUnlock => _onUnlock; public void UpdatePower( float deltaTime, bool cheat, bool grounded) { + _cheated = cheat; bool regenerate = grounded ? _regenerateOnGround : _regenerateInAir; @@ -34,9 +42,11 @@ public class PlayerPower : ScriptableObject if ( _consumed && regenerate ) { _timeSinceConsume += deltaTime; - + _cooldown = _regenerateTime - timeSinceConsume; + if ( _timeSinceConsume > _regenerateTime ) { + this.Reset(); } } diff --git a/game/Assets/Scripts/Traps/FallawayFloor.cs b/game/Assets/Scripts/Traps/FallawayFloor.cs index bef9840..0fe070b 100644 --- a/game/Assets/Scripts/Traps/FallawayFloor.cs +++ b/game/Assets/Scripts/Traps/FallawayFloor.cs @@ -1,3 +1,4 @@ +using Ktyl.Util; using System; using System.Collections; using System.Collections.Generic; @@ -14,6 +15,7 @@ public class FallawayFloor : MonoBehaviour public Material dissolve; [SerializeField] private Renderer _renderer; + [SerializeField] private SerialFloat objectTimeScale; Rigidbody rb; @@ -28,8 +30,27 @@ public class FallawayFloor : MonoBehaviour if (other.CompareTag("Player")) { // Start the Destroy floor coroutine and switch to the dissolve material. - StartCoroutine(DestroyFloor()); - _renderer.material = dissolve; + if (objectTimeScale != 0) + { + StartCoroutine(DestroyFloor()); + _renderer.material = dissolve; + } + + } + } + + //The platform gets destroyed after the player resumes frozen time on a platform + private void OnTriggerStay(Collider other) + { + if (other.CompareTag("Player")) + { + // Start the Destroy floor coroutine and switch to the dissolve material. + if (objectTimeScale != 0) + { + StartCoroutine(DestroyFloor()); + _renderer.material = dissolve; + } + } } diff --git a/game/Assets/Settings/Player/Powers/playerTimeScale.asset b/game/Assets/Scripts/Traps/objectTimeScale.asset similarity index 94% rename from game/Assets/Settings/Player/Powers/playerTimeScale.asset rename to game/Assets/Scripts/Traps/objectTimeScale.asset index b3d57a4..b5f4e0a 100644 --- a/game/Assets/Settings/Player/Powers/playerTimeScale.asset +++ b/game/Assets/Scripts/Traps/objectTimeScale.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 76553ada4233edc458c3fed9b69e128f, type: 3} - m_Name: playerTimeScale + m_Name: objectTimeScale m_EditorClassIdentifier: _initialValue: 1 _readOnly: 0 diff --git a/game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta b/game/Assets/Scripts/Traps/objectTimeScale.asset.meta similarity index 79% rename from game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta rename to game/Assets/Scripts/Traps/objectTimeScale.asset.meta index ed4d209..88d949c 100644 --- a/game/Assets/Settings/Player/Powers/playerTimeScale.asset.meta +++ b/game/Assets/Scripts/Traps/objectTimeScale.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 39c05ba9d0743074b9eb0e561ba1fcb8 +guid: 9b68e167db44c0c42837e9a679da964e NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/game/Assets/Scripts/UI/PlayerUI.cs b/game/Assets/Scripts/UI/PlayerUI.cs new file mode 100644 index 0000000..ff13a87 --- /dev/null +++ b/game/Assets/Scripts/UI/PlayerUI.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +public class PlayerUI : MonoBehaviour +{ + [SerializeField] + private Image cooldownImage; + + private float cooldownTimer = 0f; + + public void updateCooldownUI(float rawCooldownTimer, float regenerateTime) + { + if (rawCooldownTimer <= 0) + cooldownTimer = 0; + else + cooldownTimer = Mathf.Round(rawCooldownTimer) / regenerateTime; + + + cooldownImage.fillAmount = cooldownTimer; + } +} diff --git a/game/Assets/Scripts/UI/PlayerUI.cs.meta b/game/Assets/Scripts/UI/PlayerUI.cs.meta new file mode 100644 index 0000000..e69007a --- /dev/null +++ b/game/Assets/Scripts/UI/PlayerUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7befeb001df190b4b8ff21ffa8aa3eec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/Settings/Player/Powers/Freeze.asset b/game/Assets/Settings/Player/Powers/Freeze.asset index 2c64d89..ae6e1f5 100644 --- a/game/Assets/Settings/Player/Powers/Freeze.asset +++ b/game/Assets/Settings/Player/Powers/Freeze.asset @@ -12,6 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 24d28ac60e22b5547b2beb8679625039, type: 3} m_Name: Freeze m_EditorClassIdentifier: - _regenerateOnGround: 0 - _regenerateInAir: 0 - _regenerateTime: 0 + _regenerateOnGround: 1 + _regenerateInAir: 1 + _regenerateTime: 7 + _timeSinceConsume: 0 diff --git a/game/Assets/UI/PlayerUI.meta b/game/Assets/UI/PlayerUI.meta new file mode 100644 index 0000000..ed0b268 --- /dev/null +++ b/game/Assets/UI/PlayerUI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19008748323c67c42ba1b644df014f55 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/UI/PlayerUI/Cooldown.meta b/game/Assets/UI/PlayerUI/Cooldown.meta new file mode 100644 index 0000000..3440643 --- /dev/null +++ b/game/Assets/UI/PlayerUI/Cooldown.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 094334fe2c676634a87026c228e6aeeb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg b/game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg new file mode 100644 index 0000000..4ee9535 --- /dev/null +++ b/game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c75bcb3ef6e72ae527aa33c2e1d2be6c8bced00325d8dcc47c78d6ccd6ba045 +size 175542 diff --git a/game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg.meta b/game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg.meta new file mode 100644 index 0000000..17ec0c3 --- /dev/null +++ b/game/Assets/UI/PlayerUI/Cooldown/3702524 1.jpg.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: a11777191ca1ac140accf07b15900e79 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg b/game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg new file mode 100644 index 0000000..8131498 --- /dev/null +++ b/game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3dae6b02d7af4d7083509b8902be95f4139f8280e2c08bc71e253f2d19182d2 +size 55547 diff --git a/game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg.meta b/game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg.meta new file mode 100644 index 0000000..1accbe0 --- /dev/null +++ b/game/Assets/UI/PlayerUI/Cooldown/vector-hourglass-design-drawing-isolated-illustration-177176959.jpg.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: aaef6bac05ac36e48ade031f9a4230be +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: From b94d9d7f3297f7b168471318e565e9649f3c789d Mon Sep 17 00:00:00 2001 From: Novvator Date: Tue, 16 Mar 2021 15:49:54 +0000 Subject: [PATCH 4/4] changes made as per code review --- game/Assets/Prefabs/UI/PlayerFreezeUI.prefab | 322 +++++++++++++++ .../Prefabs/UI/PlayerFreezeUI.prefab.meta | 7 + game/Assets/Scenes/Main.unity | 370 +++--------------- .../Assets/Scripts/Player/PlayerController.cs | 26 +- game/Assets/Scripts/Player/PlayerPower.cs | 1 + game/Assets/Scripts/UI/FreezeUI.cs | 44 +++ .../UI/{PlayerUI.cs.meta => FreezeUI.cs.meta} | 0 game/Assets/Scripts/UI/PlayerUI.cs | 23 -- .../Settings/Player/Powers/frozenTime.asset | 16 + .../Player/Powers/frozenTime.asset.meta | 8 + 10 files changed, 449 insertions(+), 368 deletions(-) create mode 100644 game/Assets/Prefabs/UI/PlayerFreezeUI.prefab create mode 100644 game/Assets/Prefabs/UI/PlayerFreezeUI.prefab.meta create mode 100644 game/Assets/Scripts/UI/FreezeUI.cs rename game/Assets/Scripts/UI/{PlayerUI.cs.meta => FreezeUI.cs.meta} (100%) delete mode 100644 game/Assets/Scripts/UI/PlayerUI.cs create mode 100644 game/Assets/Settings/Player/Powers/frozenTime.asset create mode 100644 game/Assets/Settings/Player/Powers/frozenTime.asset.meta diff --git a/game/Assets/Prefabs/UI/PlayerFreezeUI.prefab b/game/Assets/Prefabs/UI/PlayerFreezeUI.prefab new file mode 100644 index 0000000..36d78ad --- /dev/null +++ b/game/Assets/Prefabs/UI/PlayerFreezeUI.prefab @@ -0,0 +1,322 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2220041284483646358 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2220041284483646359} + - component: {fileID: 2220041284483646357} + - component: {fileID: 2220041284483646356} + - component: {fileID: 2220041284483646354} + m_Layer: 5 + m_Name: PlayerUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2220041284483646359 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284483646358} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2220041284586465449} + - {fileID: 2220041284891186932} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2220041284483646357 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284483646358} + m_CullTransparentMesh: 1 +--- !u!114 &2220041284483646356 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284483646358} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &2220041284483646354 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284483646358} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7befeb001df190b4b8ff21ffa8aa3eec, type: 3} + m_Name: + m_EditorClassIdentifier: + cooldownImage: {fileID: 2220041284521989762} + freeze: {fileID: 11400000, guid: 0cd9cf6494bb6f54d9b97631010d780e, type: 2} + freezePanel: {fileID: 2220041284586465448} + frozenTime: {fileID: 11400000, guid: 19273ba4ac237ab4381926cfb195dda8, type: 2} +--- !u!1 &2220041284521989764 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2220041284521989765} + - component: {fileID: 2220041284521989763} + - component: {fileID: 2220041284521989762} + m_Layer: 5 + m_Name: Cooldown + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2220041284521989765 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284521989764} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2220041284891186932} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -50, y: -50} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2220041284521989763 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284521989764} + m_CullTransparentMesh: 1 +--- !u!114 &2220041284521989762 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284521989764} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: a11777191ca1ac140accf07b15900e79, type: 3} + m_Type: 3 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2220041284586465448 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2220041284586465449} + - component: {fileID: 2220041284586465463} + - component: {fileID: 2220041284586465462} + m_Layer: 5 + m_Name: FreezePanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &2220041284586465449 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284586465448} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2220041284483646359} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2220041284586465463 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284586465448} + m_CullTransparentMesh: 1 +--- !u!114 &2220041284586465462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284586465448} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0.16378963, b: 0.2264151, a: 0.392} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2220041284891186935 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2220041284891186932} + - component: {fileID: 2220041284891186930} + - component: {fileID: 2220041284891186933} + m_Layer: 5 + m_Name: Hourglass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2220041284891186932 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284891186935} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2220041284521989765} + m_Father: {fileID: 2220041284483646359} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -80, y: -78} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2220041284891186930 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284891186935} + m_CullTransparentMesh: 1 +--- !u!114 &2220041284891186933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2220041284891186935} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: aaef6bac05ac36e48ade031f9a4230be, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/game/Assets/Prefabs/UI/PlayerFreezeUI.prefab.meta b/game/Assets/Prefabs/UI/PlayerFreezeUI.prefab.meta new file mode 100644 index 0000000..2764a4f --- /dev/null +++ b/game/Assets/Prefabs/UI/PlayerFreezeUI.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9cd4e8a96e33818468d6db4407b760e3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/game/Assets/Scenes/Main.unity b/game/Assets/Scenes/Main.unity index 1257149..ed6de46 100644 --- a/game/Assets/Scenes/Main.unity +++ b/game/Assets/Scenes/Main.unity @@ -1170,81 +1170,6 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674079097563415} m_PrefabAsset: {fileID: 0} ---- !u!1 &355438498 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 355438499} - - component: {fileID: 355438501} - - component: {fileID: 355438500} - m_Layer: 5 - m_Name: Cooldown - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &355438499 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 355438498} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1864962002} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -50, y: -50} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &355438500 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 355438498} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: a11777191ca1ac140accf07b15900e79, type: 3} - m_Type: 3 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &355438501 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 355438498} - m_CullTransparentMesh: 1 --- !u!4 &359635900 stripped Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} @@ -1305,82 +1230,6 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 584f9522dd055c543863c0c60d13776e, type: 3} m_PrefabInstance: {fileID: 3060674077788289208} m_PrefabAsset: {fileID: 0} ---- !u!1 &399809200 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 399809201} - - component: {fileID: 399809203} - - component: {fileID: 399809202} - m_Layer: 5 - m_Name: PlayerUI - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &399809201 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 399809200} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1864962002} - m_Father: {fileID: 2070784762} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &399809202 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 399809200} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &399809203 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 399809200} - m_CullTransparentMesh: 1 --- !u!1 &400420174 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} @@ -1439,81 +1288,6 @@ GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674077675415875} m_PrefabAsset: {fileID: 0} ---- !u!1 &435646862 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 435646863} - - component: {fileID: 435646865} - - component: {fileID: 435646864} - m_Layer: 5 - m_Name: FreezePanel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &435646863 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 435646862} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 2070784762} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &435646864 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 435646862} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0.16378963, b: 0.2264151, a: 0.392} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &435646865 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 435646862} - m_CullTransparentMesh: 1 --- !u!4 &437846307 stripped Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 2784d88b6334dc143a910f3d252aa5df, type: 3} @@ -1719,7 +1493,7 @@ RectTransform: - {fileID: 1361646744} - {fileID: 59318656} m_Father: {fileID: 2070784762} - m_RootOrder: 2 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -2768,11 +2542,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264403 + value: -0.017264389 objectReference: {fileID: 0} - target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297725 + value: 0.009297717 objectReference: {fileID: 0} - target: {fileID: 4676633831388223329, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_IgnoreTimeScale @@ -2792,19 +2566,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.96638465 + value: 0.96638906 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.24613166 + value: 0.24613276 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.07199832 + value: 0.07193847 objectReference: {fileID: 0} - target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.018337488 + value: -0.018322242 objectReference: {fileID: 0} - target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_Name @@ -2920,16 +2694,16 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: frozenTime - value: 3 - objectReference: {fileID: 0} + value: + objectReference: {fileID: 11400000, guid: 19273ba4ac237ab4381926cfb195dda8, type: 2} - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: FreezePanel value: - objectReference: {fileID: 435646862} + objectReference: {fileID: 0} - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: cooldownImage value: - objectReference: {fileID: 355438500} + objectReference: {fileID: 0} - target: {fileID: 4676633831945762666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: objectTimeScale value: @@ -2972,11 +2746,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: -0.017264389 + value: -0.017264403 objectReference: {fileID: 0} - target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: 0.009297717 + value: 0.009297725 objectReference: {fileID: 0} - target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_XAxis.m_InvertInput @@ -3012,19 +2786,47 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.w - value: 0.99849 + value: 0.9984934 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.x - value: 0.0047656447 + value: 0.004765615 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.y - value: 0.048184585 + value: 0.04813014 objectReference: {fileID: 0} - target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} propertyPath: m_LocalRotation.z - value: -0.025949758 + value: -0.025920436 + objectReference: {fileID: 0} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.size + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.data[1].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.data[1].m_Target + value: + objectReference: {fileID: 11400000, guid: 0cd9cf6494bb6f54d9b97631010d780e, type: 2} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.data[1].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName + value: Reset + objectReference: {fileID: 0} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.data[1].m_TargetAssemblyTypeName + value: PlayerPower, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 9092426472291643813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} + propertyPath: _response.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} @@ -3620,7 +3422,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5119468870989674483, guid: fde30a46065b3b144ac612ec0b3e484a, type: 3} propertyPath: m_RootOrder - value: 4 + value: 3 objectReference: {fileID: 0} - target: {fileID: 5119468870989674483, guid: fde30a46065b3b144ac612ec0b3e484a, type: 3} propertyPath: m_AnchorMax.x @@ -5083,7 +4885,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8951021900398560347, guid: 8b2275700cf2cc5448873b7f1aa592b6, type: 3} propertyPath: m_RootOrder - value: 3 + value: 2 objectReference: {fileID: 0} - target: {fileID: 8951021900398560347, guid: 8b2275700cf2cc5448873b7f1aa592b6, type: 3} propertyPath: m_AnchorMax.x @@ -7068,82 +6870,6 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e20114b5c13a067488940c5cc8e13b60, type: 3} m_PrefabInstance: {fileID: 3060674077618818203} m_PrefabAsset: {fileID: 0} ---- !u!1 &1864962001 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1864962002} - - component: {fileID: 1864962004} - - component: {fileID: 1864962003} - m_Layer: 5 - m_Name: Hourglass - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1864962002 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1864962001} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 355438499} - m_Father: {fileID: 399809201} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -80, y: -78} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1864962003 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1864962001} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: aaef6bac05ac36e48ade031f9a4230be, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1864962004 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1864962001} - m_CullTransparentMesh: 1 --- !u!1 &1865590810 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 4a31c57c3ca869448a5849436b526efa, type: 3} @@ -7837,8 +7563,6 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 435646863} - - {fileID: 399809201} - {fileID: 483749938} - {fileID: 1356834191} - {fileID: 982982466} diff --git a/game/Assets/Scripts/Player/PlayerController.cs b/game/Assets/Scripts/Player/PlayerController.cs index 81e81d7..1cff532 100644 --- a/game/Assets/Scripts/Player/PlayerController.cs +++ b/game/Assets/Scripts/Player/PlayerController.cs @@ -78,15 +78,7 @@ public class PlayerController : MonoBehaviour private SerialFloat objectTimeScale; [SerializeField] - private float frozenTime; - - [SerializeField] - private GameObject FreezePanel; - - [SerializeField] - private Image cooldownImage; - - private float cooldownTimer = 0f; + private SerialFloat frozenTime; private enum JumpState { @@ -172,12 +164,10 @@ public class PlayerController : MonoBehaviour private void UpdateFreeze( float dt) { - updateCooldownUI(_powers.Freeze.cooldown, _powers.Freeze.regenerateTime); if ( _powers.Freeze.CanConsume && _inputHandler.InputState.Freeze.GetRawValue() ) { _powers.Freeze.Consume(); objectTimeScale.Value = 0f; - FreezePanel.SetActive(true); } if (_powers.Freeze.timeSinceConsume > frozenTime) @@ -189,21 +179,13 @@ public class PlayerController : MonoBehaviour private void UnfreezeTime() { - FreezePanel.SetActive(false); objectTimeScale.Value = 1f; } - - - public void updateCooldownUI(float rawCooldownTimer, float regenerateTime) + private void FreezeReset() { - if (rawCooldownTimer <= 0) - cooldownTimer = 0; - else - cooldownTimer = rawCooldownTimer / regenerateTime; - - cooldownImage.fillAmount = cooldownTimer; - } + _powers.Freeze.Reset(); + } private void UpdateJump(float dt) diff --git a/game/Assets/Scripts/Player/PlayerPower.cs b/game/Assets/Scripts/Player/PlayerPower.cs index 6321104..3235e51 100644 --- a/game/Assets/Scripts/Player/PlayerPower.cs +++ b/game/Assets/Scripts/Player/PlayerPower.cs @@ -62,6 +62,7 @@ public class PlayerPower : ScriptableObject { _consumed = false; _timeSinceConsume = 0f; + _cooldown = 0f; } public void Unlock() diff --git a/game/Assets/Scripts/UI/FreezeUI.cs b/game/Assets/Scripts/UI/FreezeUI.cs new file mode 100644 index 0000000..217a361 --- /dev/null +++ b/game/Assets/Scripts/UI/FreezeUI.cs @@ -0,0 +1,44 @@ +using Ktyl.Util; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +public class FreezeUI : MonoBehaviour +{ + [SerializeField] + private Image cooldownImage; + + [SerializeField] + private PlayerPower freeze; + + [SerializeField] + private GameObject freezePanel; + + [SerializeField] + private SerialFloat frozenTime; + + private float cooldownTimer = 0f; + + public void updateCooldownUI(float rawCooldownTimer, float regenerateTime, float timeSinceConsume) + { + if (rawCooldownTimer <= 0) + cooldownTimer = 0; + else + cooldownTimer = rawCooldownTimer / regenerateTime; + + cooldownImage.fillAmount = cooldownTimer; + + if (rawCooldownTimer > frozenTime) + freezePanel.SetActive(true); + else + freezePanel.SetActive(false); + } + + + + private void Update() + { + updateCooldownUI(freeze.cooldown, freeze.regenerateTime, freeze.timeSinceConsume); + } +} diff --git a/game/Assets/Scripts/UI/PlayerUI.cs.meta b/game/Assets/Scripts/UI/FreezeUI.cs.meta similarity index 100% rename from game/Assets/Scripts/UI/PlayerUI.cs.meta rename to game/Assets/Scripts/UI/FreezeUI.cs.meta diff --git a/game/Assets/Scripts/UI/PlayerUI.cs b/game/Assets/Scripts/UI/PlayerUI.cs deleted file mode 100644 index ff13a87..0000000 --- a/game/Assets/Scripts/UI/PlayerUI.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -public class PlayerUI : MonoBehaviour -{ - [SerializeField] - private Image cooldownImage; - - private float cooldownTimer = 0f; - - public void updateCooldownUI(float rawCooldownTimer, float regenerateTime) - { - if (rawCooldownTimer <= 0) - cooldownTimer = 0; - else - cooldownTimer = Mathf.Round(rawCooldownTimer) / regenerateTime; - - - cooldownImage.fillAmount = cooldownTimer; - } -} diff --git a/game/Assets/Settings/Player/Powers/frozenTime.asset b/game/Assets/Settings/Player/Powers/frozenTime.asset new file mode 100644 index 0000000..f6302e9 --- /dev/null +++ b/game/Assets/Settings/Player/Powers/frozenTime.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76553ada4233edc458c3fed9b69e128f, type: 3} + m_Name: frozenTime + m_EditorClassIdentifier: + _initialValue: 3 + _readOnly: 0 diff --git a/game/Assets/Settings/Player/Powers/frozenTime.asset.meta b/game/Assets/Settings/Player/Powers/frozenTime.asset.meta new file mode 100644 index 0000000..303a945 --- /dev/null +++ b/game/Assets/Settings/Player/Powers/frozenTime.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19273ba4ac237ab4381926cfb195dda8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: