diff --git a/Assets/Materials/Tower.mat b/Assets/Materials/Tower.mat index 41296e0..32b9bfe 100644 --- a/Assets/Materials/Tower.mat +++ b/Assets/Materials/Tower.mat @@ -116,8 +116,8 @@ Material: - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.98039216, g: 0.40243432, b: 0.050980378, a: 1} - - _Color: {r: 0.98039216, g: 0.4024343, b: 0.05098036, a: 1} + - _BaseColor: {r: 0.55360657, g: 0.6886792, b: 0.12019401, a: 1} + - _Color: {r: 0.55360657, g: 0.6886792, b: 0.12019398, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/death.mat b/Assets/Materials/death.mat index 1428607..0e8accd 100644 --- a/Assets/Materials/death.mat +++ b/Assets/Materials/death.mat @@ -116,8 +116,8 @@ Material: - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0, g: 0, b: 0, a: 1} - - _Color: {r: 0, g: 0, b: 0, a: 1} + - _BaseColor: {r: 0.8584906, g: 0.09138395, b: 0.08503916, a: 1} + - _Color: {r: 0.8584906, g: 0.09138393, b: 0.08503913, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/safe.mat b/Assets/Materials/safe.mat index f8cd6ba..d30db92 100644 --- a/Assets/Materials/safe.mat +++ b/Assets/Materials/safe.mat @@ -116,8 +116,8 @@ Material: - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 0, g: 0, b: 0, a: 1} + - _Color: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index c202e13..450eae9 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -12404,14 +12404,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image m_Material: {fileID: 0} - m_Color: {r: 0.7924528, g: 0.7924528, b: 0.7924528, a: 1} + m_Color: {r: 0.5660378, g: 0.5660378, b: 0.5660378, 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: 0e80aeef40cacfd48992718e49d75fac, type: 3} + m_Sprite: {fileID: 21300000, guid: 1f9987f7b014f424e9fcea3949340146, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -13369,7 +13369,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1613812280 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Input/InputReaderSO.cs b/Assets/Scripts/Input/InputReaderSO.cs index 8fc68b5..81c6aa6 100644 --- a/Assets/Scripts/Input/InputReaderSO.cs +++ b/Assets/Scripts/Input/InputReaderSO.cs @@ -1,4 +1,5 @@ using System; +using Unity.Mathematics; using UnityEngine; using UnityEngine.InputSystem; @@ -15,8 +16,6 @@ public class InputReaderSO : ScriptableObject, GameInputAction.IPlayerActions , } public bool isMouseButtonPressed { get;private set; } - - private bool blockedInput = false; private Vector2 _dragInput; private GameInputAction action; diff --git a/Assets/Scripts/PlatformScripts/PlatformManager.cs b/Assets/Scripts/PlatformScripts/PlatformManager.cs index 514fcad..4600052 100644 --- a/Assets/Scripts/PlatformScripts/PlatformManager.cs +++ b/Assets/Scripts/PlatformScripts/PlatformManager.cs @@ -8,7 +8,9 @@ public class PlatformManager : MonoBehaviour,IPlatformManager private float yPos = 0f; public float rotSpeed = 5f; - private float rotAmount; + + private float targetRotAmount; + private float smoothRotAmount; private void Start() { @@ -26,7 +28,18 @@ public class PlatformManager : MonoBehaviour,IPlatformManager } private void LateUpdate() { - transform.Rotate(Vector3.up * rotAmount); +#if UNITY_EDITOR || UNITY_STANDALONE + if (!inputReader.isMouseButtonPressed) return; +#endif + + smoothRotAmount = Mathf.MoveTowards( + smoothRotAmount, + targetRotAmount, + Time.deltaTime * 80f + ); + + transform.Rotate(Vector3.up * smoothRotAmount, Space.World); + } void ShowPlatforms() { @@ -47,18 +60,11 @@ public class PlatformManager : MonoBehaviour,IPlatformManager private void HandleDrag(Vector2 drag) { - rotAmount = -drag.normalized.x * rotSpeed; + float raw = drag.x / Screen.width; - //#if UNITY_EDITOR || UNITY_STANDALONE - // if (!inputReader.isMouseButtonPressed) return; - // transform.Rotate(Vector3.up * rotAmount); - - //#elif UNITY_IOS || UNITY_ANDROID - // transform.Rotate(Vector3.up * rotAmount * DPI); - - //#endif - //transform.Rotate(Vector3.up * rotAmount); + targetRotAmount = -raw * rotSpeed * 180f; + targetRotAmount = Mathf.Clamp(targetRotAmount, -10f,10f); } } diff --git a/Assets/Scripts/UI/DeathScreenController.cs b/Assets/Scripts/UI/DeathScreenController.cs index 36ee6cc..4a92e07 100644 --- a/Assets/Scripts/UI/DeathScreenController.cs +++ b/Assets/Scripts/UI/DeathScreenController.cs @@ -12,6 +12,7 @@ public class DeathScreenController:IDeathScreenController [Inject] private IInputReader IinputReader; [Inject] private IAudioController IaudioController; [Inject] private IGameSession IgameSession; + [Inject] private IGameScreenController IgameScreenController; public DeathScreenController(DeathScreenView _deathScreenView) { deathScreenView = _deathScreenView; @@ -21,6 +22,7 @@ public class DeathScreenController:IDeathScreenController public void ShowDeathScreen() { + IgameScreenController.HideGameScreen(); deathScreenView.Show(IscoreService.score,IscoreService.highScore); } @@ -38,6 +40,7 @@ public class DeathScreenController:IDeathScreenController Debug.Log("Restart Button Clicked"); IinputReader.UnlockInput(); IaudioController.PlayBtnPressedSound(); + IgameSession.showStartScreen = false; SceneManager.LoadScene(0); } } diff --git a/Assets/Scripts/UI/GameScreenController.cs b/Assets/Scripts/UI/GameScreenController.cs index 82e4d49..eede3c3 100644 --- a/Assets/Scripts/UI/GameScreenController.cs +++ b/Assets/Scripts/UI/GameScreenController.cs @@ -33,6 +33,11 @@ public class GameScreenController: IGameScreenController gameScreenView.Show(); } + public void HideGameScreen() + { + gameScreenView.Hide(); + } + public void OnPauseButtonClicked() { IaudioController.PlayBtnPressedSound(); @@ -45,4 +50,5 @@ public class GameScreenController: IGameScreenController public interface IGameScreenController { void ShowGameScreen(); + void HideGameScreen(); } diff --git a/Assets/Scripts/UI/PauseScreenController.cs b/Assets/Scripts/UI/PauseScreenController.cs index 83d7388..ead2dbd 100644 --- a/Assets/Scripts/UI/PauseScreenController.cs +++ b/Assets/Scripts/UI/PauseScreenController.cs @@ -8,6 +8,7 @@ public class PauseScreenController:IPauseScreenController private PauseScreenView pauseScreenView; [Inject] private IInputReader IinputReader; [Inject] private IAudioController IaudioController; + [Inject] private IGameSession IgameSession; public PauseScreenController(PauseScreenView _pauseScreenView) { @@ -26,6 +27,7 @@ public class PauseScreenController:IPauseScreenController Time.timeScale = 1.0f; IinputReader.UnlockInput(); IaudioController.PlayBtnPressedSound(); + IgameSession.showStartScreen = false; SceneManager.LoadScene(0); //Restart This Scene } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 937311a..7019d35 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -548,8 +548,8 @@ PlayerSettings: m_APIs: 10000000 m_Automatic: 1 - m_BuildTarget: AndroidPlayer - m_APIs: 0b00000015000000 - m_Automatic: 1 + m_APIs: 0b000000 + m_Automatic: 0 m_BuildTargetVRSettings: [] m_DefaultShaderChunkSizeInMB: 16 m_DefaultShaderChunkCount: 0