Death Zone/Respawn möglich

This commit is contained in:
Maximilian Wagner
2023-05-12 15:25:59 +02:00
parent 6590b4ccb5
commit b8ae715f05
8 changed files with 1316 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using UnityEngine;
public class respawn : MonoBehaviour
{
public GameObject player;
public Transform respawnPoint;
void Start()
{
}
void Update()
{
}
private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.CompareTag("Player"))
{
player.transform.position = respawnPoint.position;
Debug.Log("Respawn: Move");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 13af0af2052bc354cbdcc5815507a4fe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
using UnityEngine.SceneManagement;
using UnityEngine;
public class respawnReload : MonoBehaviour
{
void Start()
{
}
void Update()
{
}
private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.CompareTag("Player"))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
Debug.Log("Respawn: Reload");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd6b3102cb91bcb4d96c128170b9d140
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: