public bool TryGetGameStateSelector(EStage_State _eState, out GuideState_GameState_Selector _selector) { for (int i = 0; i < GetChildCount(); ++i) { _selector = GetChild <GuideState_GameState_Selector>(i); if (_selector != null && _selector.SelectorGameState == _eState) { return(true); } } _selector = null; return(false); }
protected override bool onEvaluate(/*in*/ TBTWorkingData wData) { GuideWorkingData gWData = wData as GuideWorkingData; EStage_State tmpCurState = EStage_State.ESS_NONE; int tmpNoviceID = -1; if (gWData != null) { tmpCurState = gWData.GuideStateBB.GetValue <EStage_State>(EGuideStateBBKey.GameStageState, EStage_State.ESS_NONE); tmpNoviceID = gWData.GuideStateBB.GetValue <int>(EGuideStateBBKey.PlayerNoviceGuideType, -1); } if (m_eOldStage != EStage_State.ESS_NONE && m_eOldStage != tmpCurState) { GuideManager.Instance.DestroyOldDynamicGuideRoot(wData); } else if (m_eOldStage != EStage_State.ESS_NONE && m_eOldStage == tmpCurState) { if (tmpNoviceID != -1 && tmpNoviceID != m_nNoviceID) { GuideManager.Instance.DestroyOldDynamicGuideRoot(wData); } } m_eOldStage = tmpCurState; m_nNoviceID = tmpNoviceID; TBTActionPrioritizedSelectorContext thisContext = getContext <TBTActionPrioritizedSelectorContext>(wData); thisContext.currentSelectedIndex = -1; int childCount = GetChildCount(); for (int i = 0; i < childCount; ++i) { TBTAction node = GetChild <TBTAction>(i); if (node.Evaluate(wData)) { thisContext.currentSelectedIndex = i; return(true); } } return(false); }
public override bool SetStageState(EStage_State _NewState) { if (CurrentStageState == _NewState) { return(false); } Trace.Log("StageManager old StageState=" + CurrentStageState); onLeave(); if (onStageStateChanged != null) { onStageStateChanged.Invoke(CurrentStageState, _NewState); } CurrentStageState = _NewState; onEnter(); Trace.Log("StageManager current StageState=" + CurrentStageState); return(true); }
public GuideState_GameState_Selector(EStage_State _eGameState) { m_eSelectorGameState = _eGameState; this.SetPrecondition(new CON_IsGameStateExit(_eGameState)); }
public abstract bool SetStageState(EStage_State _NewState);
public CON_IsGameStateExit(EStage_State _eGameState) { m_eGameState = _eGameState; }