Пример #1
0
 protected override void OnHidePanel()
 {
     base.OnHidePanel();
     m_currentState = BattleManager.BattleViewStates.None;
     m_currentRole  = null;
     m_selectItem   = null;
     m_curItemList.Clear();
 }
Пример #2
0
    IBattleState GetState(BattleManager.BattleViewStates state)
    {
        IBattleState obj;

        if (m_stateDic.TryGetValue(state, out obj))
        {
            return(obj);
        }
        return(null);
    }
Пример #3
0
 protected override void OnShowPanel(params object[] allParams)
 {
     base.OnShowPanel(allParams);
     m_currentRole = allParams[0] as RoleInstance;
     if (m_currentRole == null)
     {
         return;
     }
     if (allParams.Length > 1)
     {
         m_currentState = (BattleManager.BattleViewStates)allParams[1];
     }
     Cancel_Button.gameObject.SetActive(false);
     SetActionBtnState();
     RefreshSkill();
     SetPanelState();
 }
Пример #4
0
    public void StopStateMechine(BattleResult result)
    {
        //清理所有格子
        BattleboxHelper.Instance.ClearAllBlocks();
        //相机照射主角
        CameraHelper.Instance.ChangeFollow(GameRuntimeData.Instance.Player.View.transform);
        //Jyx2_UIManager.Instance.HideUI("BattleActionOrderPanel");
        IBattleState curState = GetState(m_currentState);

        if (curState != null)
        {
            curState.OnLeaveState();
        }
        if (m_roleFocusRing != null)
        {
            Jyx2ResourceHelper.ReleasePrefabInstance(m_roleFocusRing);
            m_roleFocusRing = null;
        }
        m_currentState = BattleManager.BattleViewStates.None;
        CurrentRole    = null;
        m_callback?.Invoke(result);
    }
Пример #5
0
    public void SwitchState(BattleManager.BattleViewStates toState)
    {
        if (toState == m_currentState)
        {
            IBattleState temp = GetState(toState);
            temp.RefreshState();//说明是刷新状态
            return;
        }
        IBattleState toObj = GetState(toState);

        if (toObj == null)
        {
            Debug.LogError("不存在状态" + toState.ToString() + ",无法完成转换");
            return;
        }
        IBattleState curState = GetState(m_currentState);

        if (curState != null)
        {
            curState.OnLeaveState();
        }
        m_currentState = toState;
        toObj.OnEnterState();
    }