4b7bb231a9
ALSO installed TMP but it has been giving me ISSUES
25 lines
610 B
C#
25 lines
610 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class StateController : MonoBehaviour {
|
|
|
|
[Header("Respawning")]
|
|
[SerializeField] GameObject player;
|
|
public GameObject spawnPoint;
|
|
[SerializeField] private GameObject deathCanvas;
|
|
|
|
void Awake() {
|
|
deathCanvas.SetActive(false);
|
|
}
|
|
|
|
public void RespawnPlayer() {
|
|
ToggleDeathCanvas();
|
|
Instantiate(player, spawnPoint.transform.position, spawnPoint.transform.rotation);
|
|
}
|
|
|
|
public void ToggleDeathCanvas() {
|
|
deathCanvas.SetActive(!deathCanvas.activeSelf);
|
|
}
|
|
}
|