Example #1
0
 public void NextActionUnit()
 {
     if (Remaining_ORL.Count == 0)
     {
         return;
     }
     if (Remaining_SRL.Count == 0)
     {
         return;
     }
     if (_currentBattleUnit != null)
     {
         _currentBattleUnit.actionSign.gameObject.SetActive(false);
     }
     _currentBattleUnit = All_Array[0];
     All_Array.Remove(_currentBattleUnit);
     All_Array.Add(_currentBattleUnit);
     if (_currentBattleUnit.IsDead)
     {
         NextActionUnit();
         return;
     }
     if (_currentBattleUnit.ReadThisStateEnable(StateTag.Dizzy))
     {
         _currentBattleUnit.CheckStates();
         if (SDGameManager.Instance.isFastModeEnabled)
         {
             NextActionUnit();
         }
         return;
     }
     _currentBattleUnit.actionSign.gameObject.SetActive(true);
     _currentActionPanel = _currentBattleUnit.APC;
     checkCurrentUnitTag();
     //
     _currentBattleUnit.CheckStates();//计算角色状态对其影响
     if (_currentBattleUnit.IsDead)
     {
         NextActionUnit();
         return;//重新进行死亡判断
     }
     if (_currentBUType != SDConstants.CharacterType.Enemy)
     {
         if (SDDataManager.Instance.SettingData.isAutoBattle)
         {
             _currentActionPanel.chooseRandomSkillFromGroup();
             chooseAutoBattleTarget();
             handleAction();
         }
         else
         {
             SDGameManager.Instance.isUsingProp = false;
             //
             IsWaitingPlayerAction = true;
             //显示全部可用交互
             _currentActionPanel.showActionPanel();
             //UsingPropBtn.interactable = true;
             CancelBtn.interactable = true;
         }
     }
     else
     {
         _currentActionPanel.showActionPanel();
         _currentActionPanel.chooseASkillFromSkillGroup();
         chooseRandomHeroToAttack();
         handleAction();
     }
     currentTouchId   = -1;
     confirmSkillStep = 0;
 }
Example #2
0
    void FixedUpdate()
    {
        //IsWaitingPlayerAction = ABM.IsWaitingAction;
        if (CountDownTime > 0)
        {
            CountDownTime -= Time.deltaTime;
            return;
        }
        if (IsWaitingPlayerAction)
        {
            if (SDDataManager.Instance.SettingData.isAutoBattle &&
                _currentActionPanel != null)
            {
                IsWaitingPlayerAction = false;

                _currentActionPanel.hideActionPanel();

                //UsingPropBtn.interactable = false;
                CancelBtn.interactable = false;

                _currentActionPanel.chooseASkillFromSkillGroup();

                //chooseAutoBattleTarget();
                if (_currentBattleUnit.IsEnemy)
                {
                    chooseRandomHeroToAttack();
                }
                else
                {
                    chooseAutoBattleTarget();
                }

                CountDownTime = 1.5f;
                handleAction();
            }
            else
            {
                if (SDGameManager.Instance.isUsingProp)//正在使用道具
                {
                    if (_PropTarget == SDConstants.AUTO_TARGET_TAG)
                    {
                        if (Input.GetMouseButtonDown(0))
                        {
                            ActionConfirm = true;
                        }
                    }
                    else
                    {
                        //SelectController.GetComponent<Image>().raycastTarget = true;
                        //使用QuicklySelectSkillTarget来选择和判断角色
                        if (Input.GetMouseButtonDown(0))
                        {
                            int touchId = SelectController.WhenPointDownIndex();
                            if (All_Array[touchId].IsOptionTarget)
                            {
                                ActionConfirm  = true;
                                PropTargetUnit = All_Array[touchId];
                                SelectController.ConfirmTarget(touchId);
                            }
                            else
                            {
                                RolePlayJumpAnim(All_Array[touchId]);
                                Debug.Log("无效目标");
                            }
                        }
                    }
                    if (ActionConfirm)
                    {
                        ActionConfirm = false;
                        CountDownTime = 0.5f;
                        startUseProp();
                        CancelBtn.interactable = false;
                        hideOptionTarget();
                        SelectController.ResetTarget();
                        //handleAction();
                    }
                }
                else
                {
                    if (!SDGameManager.Instance.isGamePaused && confirmSkillStep != 2)
                    {
                        if (ActionConfirm && confirmSkillStep == 1)
                        {
                            ActionConfirm    = false;
                            confirmSkillStep = 2;
                            CountDownTime    = 0.75f;
                            //
                            Debug.Log("目标为:" + _currentTUType + " name:" + _currentTargetUnit.name);
                            RolePlayJumpAnim(_currentTargetUnit);
                            handleAction();
                        }
                    }
                }
            }
        }
    }