Beispiel #1
0
        //手动操作完成
        private void ManualOperationComplete()
        {
            //切换状态
            manualOperationState = ManualOperationState.Waiting;
            skillOperationType   = SkillOperationType.None;

            //清空状态
            CleanState(false, false);

            //清空手动操作单位
            if (manualOperatingBattleUnitRenderer != null)
            {
                manualOperatingBattleUnitRenderer.battleUnit.CompleteManualState(ManualActionState.Skill);
                manualOperatingBattleUnitRenderer.battleUnit.CompleteManualState(ManualActionState.Move);
                manualOperatingBattleUnitRenderer.UpdateRenderState(BattleUnitRenderState.Normal);
                manualOperatingBattleUnitRenderer = null;
            }

            //关闭操作菜单
            UIViewManager.Instance.HideView(UIViewName.BattleFieldPlayerActOption);

            //使用了手动分析器
            if (usedManualReleaseAnalysisor != null)
            {
                usedManualReleaseAnalysisor.Reset();
            }

            //显示后通知手动操作完成
            EventManager.Instance.Run(EGameConstL.EVENT_MANUAL_OPERATION_COMPLETE, null);
        }
Beispiel #2
0
        //点击了技能,在单体带环绕的技能情况下
        private void OnBattleUnitAndGridTouched_StateSkill_SurroundBattleUnit(GridUnit gridTouched, BattleUnit battleUnitTouched)
        {
            //没有点中战斗单位
            if (battleUnitTouched == null)
            {
                return;
            }

            //是否是有效单位
            if (usedManualReleaseAnalysisor.suitableUnits.Contains(battleUnitTouched))
            {
                //重复点击同一个有效的战斗单位,则释放技能
                if (battleUnitTouched.battleUnitRenderer.Equals(selectedBattleUnitRenderer))
                {
                    ManualSkill(battleUnitTouched);
                    return;
                }
                else if (selectedBattleUnitRenderer != null)
                {
                    //取消选中
                    selectedBattleUnitRenderer.UpdateRenderState(BattleUnitRenderState.Normal);
                }
                //显示新的范围
                selectedBattleUnitRenderer = battleUnitTouched.battleUnitRenderer;
                //范围内战斗单位设置为选中
                for (int i = 0; i < usedManualReleaseAnalysisor.suitableUnits.Count; ++i)
                {
                    if (usedManualReleaseAnalysisor.suitableUnits[i].mapGrid.Distance(gridTouched) <= usedManualReleaseAnalysisor.battleSkill.effectRadius)
                    {
                        usedManualReleaseAnalysisor.suitableUnits[i].battleUnitRenderer.UpdateRenderState(BattleUnitRenderState.Selected);
                    }
                }
                SetCircularRangeRenderStateActive(
                    true,
                    GridRenderType.SkillEffectRange,
                    gridTouched.row,
                    gridTouched.column,
                    usedManualReleaseAnalysisor.battleSkill.effectRadius);
            }
            //不是有效单位
            else if (usedManualReleaseAnalysisor.distanceLimit.Contains(battleUnitTouched))
            {
                UtilityHelper.Log("目标超出攻击范围");
            }

            //队伍不符合
            else if (usedManualReleaseAnalysisor.teamLimit.Contains(battleUnitTouched))
            {
                UtilityHelper.Log("不能对同一个队伍的单位使用这个技能");
            }

            else
            {
                UtilityHelper.Log("目标单位无效");
            }
        }
Beispiel #3
0
        //手动操作完成
        private void ManualOperationComplete()
        {
            //切换状态
            manualOperationState = ManualOperationState.Waiting;
            skillOperationType   = SkillOperationType.None;

            //清空状态
            CleanState(false, false);

            //清空手动操作单位
            if (manualOperatingBattleUnitRenderer != null)
            {
                manualOperatingBattleUnitRenderer.battleUnit.CompleteManualState(ManualActionState.Skill);
                manualOperatingBattleUnitRenderer.battleUnit.CompleteManualState(ManualActionState.Move);
                manualOperatingBattleUnitRenderer.UpdateRenderState(BattleUnitRenderState.Normal);
                manualOperatingBattleUnitRenderer = null;
            }

            //关闭操作菜单
            UIViewManager.Instance.HideView(UIViewName.BattleFieldPlayerActOption);

            //显示后通知手动操作完成
            fieldRenderer.PlayBattle(fieldRenderer.battleField.ManualOperationComplete);
        }