lost me mind i did

This commit is contained in:
2022-08-16 01:49:55 -07:00
parent 64a399990c
commit 4255ed97e7
100 changed files with 10152 additions and 7647 deletions

View File

@@ -0,0 +1,28 @@
using UnityEngine;
public class PlayerSpawnController : MonoBehaviour
{
[SerializeField]
private GameObject _player;
[SerializeField]
private GameObject _playerPrefab;
[SerializeField]
private GameObject _spawnLocation;
void Awake()
{
if (GameObject.FindGameObjectWithTag("Player") != null)
{
_player = GameObject.FindGameObjectWithTag("Player");
_player.transform.position = _spawnLocation.transform.position;
}
else
{
_player = Instantiate(_playerPrefab);
_player.transform.position = _spawnLocation.transform.position;
DontDestroyOnLoad(_player);
}
}
}