Death Zone/Respawn möglich
This commit is contained in:
24
Assets/AssetsFORELLE/Script/respawn.cs
Normal file
24
Assets/AssetsFORELLE/Script/respawn.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/AssetsFORELLE/Script/respawn.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/respawn.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13af0af2052bc354cbdcc5815507a4fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/AssetsFORELLE/Script/respawnReload.cs
Normal file
22
Assets/AssetsFORELLE/Script/respawnReload.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/AssetsFORELLE/Script/respawnReload.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/respawnReload.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd6b3102cb91bcb4d96c128170b9d140
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user