2026-07-14 씬체인지

This commit is contained in:
2026-07-14 11:51:45 +09:00
parent 058783d10d
commit 0e0e12a768
33 changed files with 268 additions and 41 deletions

View File

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