URP 제거 및 유니티짱 에셋 추가
This commit is contained in:
@@ -2,10 +2,14 @@ using UnityEngine;
|
||||
|
||||
public class Managers : MonoBehaviour
|
||||
{
|
||||
static Managers s_instance; // static으로 유일성 보장
|
||||
|
||||
public static Managers Instance { get { Init(); return s_instance; } } // 유일한 매니저를 가져온다.
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
// 초기화
|
||||
Init();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -13,4 +17,21 @@ public class Managers : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void Init()
|
||||
{
|
||||
if (s_instance == null)
|
||||
{
|
||||
GameObject go = GameObject.Find("@Managers");
|
||||
|
||||
if (go == null)
|
||||
{
|
||||
go = new GameObject("@Managers");
|
||||
go.AddComponent<Managers>();
|
||||
}
|
||||
|
||||
DontDestroyOnLoad(go);
|
||||
s_instance = go.GetComponent<Managers>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
Assets/Scripts/Managers/Player.cs
Normal file
16
Assets/Scripts/Managers/Player.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Player : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
Managers mg = Managers.Instance;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Managers/Player.cs.meta
Normal file
2
Assets/Scripts/Managers/Player.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e77a5909a15b92544bcd0b48ddd60059
|
||||
Reference in New Issue
Block a user