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); } }