singleton 썸네일형 리스트형 유니티 - 싱글톤 패턴(Singleton) 싱글톤 패턴은 가장 많이 사용하는 기본 패턴이니 따로 설명이 필요 없을 것 같습니다.바로 간편하게 적용할 수 있는 코드로 넘어가 보겠습니다.using UnityEngine;public class Singleton : MonoBehaviour where T : MonoBehaviour { public static T instance {get; private set;} protected virtual void Awake() { if (instance == null) { instance = (T)FindObjectOfType(typeof(T)); DontDestroyOnLoad(gameObject); } else { .. 더보기 이전 1 다음