public static void RemoveAllPackages(bool allowDestroyAssets) { if (_packageInstById.Count > 0) { UIPackage[] pkgs = _packageList.ToArray(); foreach (UIPackage pkg in pkgs) { pkg.Dispose(allowDestroyAssets); } } _packageList.Clear(); _packageInstById.Clear(); _packageInstByName.Clear(); }
void OnApplicationQuit() { if (Application.isEditor) { UIPackage.RemoveAllPackages(true); } }