public void ReleaseAll() { Dictionary <Type, BaseUIController> .Enumerator iter = controllerMaps.GetEnumerator(); while (iter.MoveNext()) { BaseUIController controller = iter.Current.Value; controller.Hide(); controller.Destroy(); } }
public void RemoveController <T>() where T : BaseUIController { BaseUIController controller = null; if (controllerMaps.TryGetValue(typeof(T), out controller)) { Debug.LogWarning("remove controller not exist " + typeof(T)); } else { controllerMaps.Remove(typeof(T)); controller.Destroy(); } }