ofb/Assets/Scripts/StateController.cs
slevy14 32a1412a57 added animation and camera
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
2023-04-19 21:34:00 -07:00

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