public void Unload(int id) { UIViewModel vm = GetViewModelByID(id); if (vm != null) { Destroy(vm.gameObject); } }
public void SetActive(int id, bool active) { UIViewModel vm = GetViewModelByID(id); if (vm != null) { vm.gameObject.SetActive(active); } }
public void Unregister(UIViewModel vm) { if (_viewModelDict.ContainsKey(UIViewModel.id)) { _viewModelDict.Remove(UIViewModel.id); } else { LogManager.LogWarning("UISysManager:Unregister ", vm.name + " not exists!"); } }
public int Register(UIViewModel vm) { int id = AssignID(); if (_viewModelDict.ContainsKey(id)) { LogManager.LogWarning("UISysManager:Register", vm.name + " has already exists!"); } else { _viewModelDict.Add(id, vm); } return(id); }