public void Unload(bool cache = true) { OnUnload(); UIPanelManager.Instance.Remove(this); actions.Clear(); foreach (var item in assets) { item.Value.Release(); } assets.Clear(); if (cache && UIPanelManager.Instance.Cache(this)) { return; } if (asset != null) { asset.Release(); asset = null; } if (gameObject != null) { GameObject.Destroy(gameObject); gameObject = null; } }
private void OnDestroy() { if (asset != null) { asset.Release(); asset = null; } }
public static void Unload(Asset asset) { asset.Release(); }
internal void Unload() { asset.Release(); asset = null; }