예제 #1
0
 void OnDestroy()
 {
     if (_inst == this)
     {
         _inst = null;
     }
 }
예제 #2
0
    void Awake()
    {
        if (_inst != null)
        {
            Debug.LogError("CharacterDictionary: detected singleton instance has existed. Destroy this one " + gameObject.name);
            Destroy(this);
            return;
        }

        _inst = this;
    }