모노 싱글톤



MonoSingleton<T>.cs 소스입니다


using UnityEngine;

public class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour
{
public static T Inst { get; private set; }
void Awake() => Inst = FindObjectOfType(typeof(T)) as T;
}