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

        _inst = this;
    }
Beispiel #2
0
 void OnDestroy()
 {
     if (_inst == this)
     {
         _inst = null;
     }
     foreach (System.Collections.Generic.List <IconInfo> l in _heroIcons)
     {
         foreach (IconInfo ii in l)
         {
             ii.texture.Release();
         }
     }
 }