2026-07-14 씬체인지
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
public class GameManager : MonoBehaviour,ISceneInitializable
|
||||
{
|
||||
public static GameManager Instance { get; private set; }
|
||||
|
||||
public GameObject Player {get; private set;}
|
||||
public PlayerController PController => Player != null ? Player.GetComponent<PlayerController>() : null;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
@@ -15,4 +18,9 @@ private void Awake()
|
||||
Destroy(gameObject); //이미 인스턴스가 있으면 자신을 파괴
|
||||
}
|
||||
}
|
||||
|
||||
public void OnSceneLoaded()
|
||||
{
|
||||
Player = GameObject.FindWithTag("Player");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user