19 lines
452 B
C#
19 lines
452 B
C#
using UnityEngine;
|
|
|
|
public class PlayerSpawnController : MonoBehaviour
|
|
{
|
|
public GameObject Player;
|
|
[SerializeField]
|
|
private GameObject _playerPrefab;
|
|
[SerializeField]
|
|
private GameObject _spawnLocation;
|
|
|
|
private void Start()
|
|
{
|
|
Player = Instantiate(_playerPrefab);
|
|
Player.transform.position = _spawnLocation.transform.position;
|
|
Player.transform.rotation = _spawnLocation.transform.rotation;
|
|
DontDestroyOnLoad(Player);
|
|
}
|
|
|
|
} |