Unity1 01_05_유니티 기초_Singleton 패턴 Q1. Managers를 싱글톤으로 구현하고 Player 오브젝트에서 사용할 수 있게 만들어 보자. @Managers 오브젝트가 없다면 코드로 생성하고 Managers 스크립트를 붙여지게 만들어 보자. Managers.cs using System.Collections; using System.Collections.Generic; using UnityEngine; public class Managers : MonoBehaviour { static Managers s_instance; // 유일성이 보장된다. public static Managers Instance { get { Init(); return s_instance; } } // 유일한 매니저를 갖고온다. // Start is called befo.. Unity engine 2022. 8. 25. 이전 1 다음