reset button

This commit is contained in:
Bruno Rybársky 2021-07-21 16:18:46 +02:00
parent 008be6efea
commit 6f7b8bfe6a
5 changed files with 32 additions and 35 deletions

@ -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

@ -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}

@ -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<Rigidbody2D>().velocity = Vector3.zero;
sfx.clip = damage;
sfx.Play();
}
Vector3 playpos = transform.position;
playpos.z = 0f;
transform.position = playpos;

@ -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:

@ -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