32a1412a57
camera movement is very basic, animation is just right facing lol. also i know the organization is a bit of a mess, i promise i'll fix it
26 lines
709 B
C#
26 lines
709 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() {
|
|
SetDeathCanvasActive(false);
|
|
GameObject.Find("Main Camera").GetComponent<CameraMovement>().FindPlayer();
|
|
Instantiate(player, spawnPoint.transform.position, spawnPoint.transform.rotation);
|
|
}
|
|
|
|
public void SetDeathCanvasActive(bool activeState) {
|
|
deathCanvas.SetActive(activeState);
|
|
}
|
|
}
|