From 6f7b8bfe6a611619b237bd42f2e2646361bb7cc3 Mon Sep 17 00:00:00 2001 From: BRNSystems Date: Wed, 21 Jul 2021 16:18:46 +0200 Subject: [PATCH] reset button --- Assets/Scenes/Level1.unity | 36 +++------------------------ Assets/Scenes/Tutorial.unity | 2 ++ Assets/Scripts/PlayerControls.cs | 9 +++++++ ProjectSettings/InputManager.asset | 16 ++++++++++++ UserSettings/EditorUserSettings.asset | 4 +-- 5 files changed, 32 insertions(+), 35 deletions(-) diff --git a/Assets/Scenes/Level1.unity b/Assets/Scenes/Level1.unity index ee774b8..6638547 100644 --- a/Assets/Scenes/Level1.unity +++ b/Assets/Scenes/Level1.unity @@ -135,7 +135,6 @@ GameObject: - component: {fileID: 44549256} - component: {fileID: 44549255} - component: {fileID: 44549254} - - component: {fileID: 44549257} m_Layer: 3 m_Name: Circle m_TagString: Untagged @@ -245,21 +244,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!114 &44549257 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 44549252} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 20c0ecf95ac68c343bdf7b8295ff699c, type: 3} - m_Name: - m_EditorClassIdentifier: - width: 0 - height: -1.4 - speed: 1.76 --- !u!1 &48681354 GameObject: m_ObjectHideFlags: 0 @@ -6657,6 +6641,8 @@ MonoBehaviour: top: {fileID: 6200000, guid: 1431532fb1c75214a9a8c9b1199fe80b, type: 2} rb: {fileID: 685738184} RotateSFX: {fileID: 8300000, guid: 9308767361e69644fb449e62c7403639, type: 3} + damage: {fileID: 8300000, guid: 48964eead8994c2448e0079ace97b563, type: 3} + spawnstor: {fileID: 806054524} sprite: {fileID: 685738188} bottom: {fileID: 6200000, guid: 2c0538ecede9d3b43867ca45f72ba04b, type: 2} controller: {fileID: 685738186} @@ -17160,7 +17146,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1137646167} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -1.8, z: 0} + m_LocalPosition: {x: 0, y: -1.9, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 685738189} @@ -32259,7 +32245,6 @@ GameObject: - component: {fileID: 1657599957} - component: {fileID: 1657599956} - component: {fileID: 1657599955} - - component: {fileID: 1657599958} m_Layer: 3 m_Name: Circle (1) m_TagString: Untagged @@ -32369,21 +32354,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!114 &1657599958 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1657599953} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 20c0ecf95ac68c343bdf7b8295ff699c, type: 3} - m_Name: - m_EditorClassIdentifier: - width: 0 - height: -1.36 - speed: 1.2 --- !u!1 &1748848846 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Tutorial.unity b/Assets/Scenes/Tutorial.unity index 4eed38b..5fc881e 100644 --- a/Assets/Scenes/Tutorial.unity +++ b/Assets/Scenes/Tutorial.unity @@ -292,6 +292,8 @@ MonoBehaviour: top: {fileID: 6200000, guid: 1431532fb1c75214a9a8c9b1199fe80b, type: 2} rb: {fileID: 4766646} RotateSFX: {fileID: 8300000, guid: 9308767361e69644fb449e62c7403639, type: 3} + damage: {fileID: 8300000, guid: 48964eead8994c2448e0079ace97b563, type: 3} + spawnstor: {fileID: 1523500533} sprite: {fileID: 4766650} bottom: {fileID: 6200000, guid: 2c0538ecede9d3b43867ca45f72ba04b, type: 2} controller: {fileID: 4766648} diff --git a/Assets/Scripts/PlayerControls.cs b/Assets/Scripts/PlayerControls.cs index 98c3c09..6106ae9 100644 --- a/Assets/Scripts/PlayerControls.cs +++ b/Assets/Scripts/PlayerControls.cs @@ -9,6 +9,9 @@ public class PlayerControls : MonoBehaviour public Rigidbody2D rb; public AudioClip RotateSFX; + public AudioClip damage; + public SpawnStorage spawnstor; + public SpriteRenderer sprite; public PhysicsMaterial2D bottom; public CharacterController2D controller; @@ -42,6 +45,12 @@ public class PlayerControls : MonoBehaviour sfx.clip = RotateSFX; sfx.Play(); } + if(Input.GetButtonDown("Reset")) { + transform.position = spawnstor.spawnpoint; + transform.GetComponent().velocity = Vector3.zero; + sfx.clip = damage; + sfx.Play(); + } Vector3 playpos = transform.position; playpos.z = 0f; transform.position = playpos; diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index c51c96c..fd7a524 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -117,6 +117,22 @@ InputManager: type: 0 axis: 0 joyNum: 0 + - serializedVersion: 3 + m_Name: Reset + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: r + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 - serializedVersion: 3 m_Name: Mouse X descriptiveName: diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index cfb41e7..a67ecef 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -9,13 +9,13 @@ EditorUserSettings: value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d flags: 0 RecentlyUsedScenePath-1: - value: 22424703114646680e0b0227036c6b0502180a232d2468252320092a + value: 22424703114646680e0b0227036c73150012147b623d28393930 flags: 0 RecentlyUsedScenePath-2: value: 22424703114646680e0b0227036c7919181e0b22623d28393930 flags: 0 RecentlyUsedScenePath-3: - value: 22424703114646680e0b0227036c73150012147b623d28393930 + value: 22424703114646680e0b0227036c6b0502180a232d2468252320092a flags: 0 UnityRemoteCompression: value: 337f73