示例#1
0
        private void GenerateStates()
        {
            foreach (var container in _panelMenuList)
            {
                Type typeName = Type.GetType(GetType().Namespace + "." + container.name + "State");

                if (typeName != null)
                {
                    Object[] args        = { this };
                    AUIState newAuiState = Activator.CreateInstance(typeName, args) as AUIState;
                    string   typeNameStr = typeName.Name.ToLower();

                    for (UIStateEnum state = UIStateEnum.NONE; state <= UIStateEnum.OPTIONSMENU; ++state)
                    {
                        if (newAuiState != null &&
                            !_stateDictionary.ContainsKey(state) &&
                            typeNameStr.Contains(state.ToString().ToLower()))
                        {
                            newAuiState.Setup(container.transform);
                            _stateDictionary.Add(state, newAuiState);

                            break;
                        }
                    }
                }
            }
        }
        public void PushNewState(UIStateEnum stateEnum, object valueIn = null, object valueIn1 = null, bool bNeedWait = true, object valueIn2 = null)
        {
            GuLog.Debug("<><DrinkWaterUIPresentManager> PushNewState:  " + stateEnum.ToString());

            PushNewState(new UIState
            {
                state    = stateEnum,
                value0   = valueIn,
                value1   = valueIn1,
                value2   = valueIn2,
                needWait = bNeedWait
            });
        }
 MainPresentBase GetPresentByEnum(UIStateEnum state)
 {
     if (allIPresents == null)
     {
         return(null);
     }
     foreach (var ret in allIPresents)
     {
         if (state == ret.GetStateEnum())
         {
             GuLog.Debug("<><DrinkWaterUIPresentManager> NextState:" + state.ToString());
             return(ret);
         }
     }
     return(null);
 }
示例#4
0
 //public void ShowAlertPair(AlertBoard.AlertType type)
 //{
 //    alertBoardSignal.Dispatch(type);
 //}
 public override void TestSerializeField()
 {
     //Assert.IsNotNull(silenceTimeProcess);
     Assert.IsNotNull(mainUIObject);
     Assert.IsNotNull(rolePlayer);
     Assert.IsNotNull(guestPlayer);
     Assert.IsNotNull(objTextTmallRoot);
     MainPresentBase[] allIPresents = transform.GetComponentsInChildren <MainPresentBase>(true);
     for (UIStateEnum i = UIStateEnum.eStartDailyProcessBar; i < UIStateEnum.eTotalUiState; ++i)
     {
         bool bFound = false;
         foreach (var p in allIPresents)
         {
             if (p.GetStateEnum() == i)
             {
                 bFound = true;
                 break;
             }
         }
         Assert.IsTrue(bFound, "No present:" + i.ToString());
     }
     //Assert.IsTrue(aniTmallRemind != null);
 }