void Awake() { if (_inst != null) { Debug.LogError("HeroIconRenderer: detected singleton instance has existed. Destroy this one " + gameObject.name); Destroy(this); return; } _inst = this; }
void OnDestroy() { if (_inst == this) { _inst = null; } foreach (System.Collections.Generic.List <IconInfo> l in _heroIcons) { foreach (IconInfo ii in l) { ii.texture.Release(); } } }