コード例 #1
0
        private void Awake()
        {
            if (_instance != null && _instance != this)
            {
                Destroy(gameObject);
            }

            _instance = this;
        }
コード例 #2
0
 private void OnDestroy()
 {
     _instance = null;
 }