Example #1
0
        public void Unload(int id)
        {
            UIViewModel vm = GetViewModelByID(id);

            if (vm != null)
            {
                Destroy(vm.gameObject);
            }
        }
Example #2
0
        public void SetActive(int id, bool active)
        {
            UIViewModel vm = GetViewModelByID(id);

            if (vm != null)
            {
                vm.gameObject.SetActive(active);
            }
        }
Example #3
0
 public void Unregister(UIViewModel vm)
 {
     if (_viewModelDict.ContainsKey(UIViewModel.id))
     {
         _viewModelDict.Remove(UIViewModel.id);
     }
     else
     {
         LogManager.LogWarning("UISysManager:Unregister ", vm.name + " not exists!");
     }
 }
Example #4
0
        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);
        }