void Awake() { if (Application.isPlaying) { _instance = this; StartCoroutine(LoadingTex()); } else { } }
public void FreeMemory(Action callback = null) { if (m_ListTexture != null) { for (int i = 0; i < m_ListTexture.Length; i++) { m_ListTexture[i] = null; } m_ListTexture = null; _instance = null; GameObject.Destroy(gameObject); Resources.UnloadUnusedAssets(); System.GC.Collect(); if (callback != null) { callback(); } } }