Exemplo n.º 1
0
    private static void CheckClickSkillTarget(GameObject go)
    {
        if (go == null)
        {
            return;
        }
        // 判断点击的是否是可被点击的船
        TeamDisplay        display = Instance.GetTeamDisplay(go.transform);
        List <TeamDisplay> list    = SkillTargetSelector.FindSkillTarget(GetCommanderShipTeam(), SelectedSkill);

        if (!list.Contains(display))
        {
            return;
        }
        Instance.SkillSelectParam_ = display;
        IsSelectedSkillTarget      = true;
    }
Exemplo n.º 2
0
    /// <summary>
    /// 显示旗舰技能目标的框
    /// </summary>
    /// <returns></returns>
    private IEnumerator DelayCheckCommanderShipSkillTarget()
    {
        GameObject shipGo = GetCommanderShipObj();

        if (shipGo == null)
        {
            yield break;
        }
        TeamDisplay commanderDisplay = GetCommanderShipTeam();

        if (commanderDisplay == null)
        {
            yield break;
        }
        ClientSkill skill = SelectedSkill_;

        if (skill == null)
        {
            yield break;
        }

        // 技能选择时的标志
        while (true)
        {
            // 如果旗舰不存在了
            if (shipGo == null)
            {
                yield break;
            }

            if (skill.Prop.skill_select_type == Def.SkillSelectType.CastScope || skill.Prop.skill_select_type == Def.SkillSelectType.NoSelection)
            {
                List <TeamDisplay> list1 = SkillTargetSelector.FindSkillTarget(commanderDisplay, skill);
                // 矩形
                if (skill.Prop.shape_type == Def.ShapeType.Rectangle)
                {
                    CheckLastFrameArrowGroupList(list1);
                    CheckAllSkillTarget(list1);
                }
                // 圆形或扇形
                else if (skill.Prop.shape_type == Def.ShapeType.Circle || skill.Prop.shape_type == Def.ShapeType.Default)
                {
                    CheckLastFrameArrowGroupList(list1);
                    CheckAllSkillTarget(list1);
                }
            }
            else if (skill.Prop.skill_select_type == Def.SkillSelectType.PlayerSelect)
            {
                // 为0时让玩家点击屏幕选择舰船或空处,显示可点击的舰船
                if (!IsSelectedSkillTarget)
                {
                    List <TeamDisplay> list2 = SkillTargetSelector.FindSkillTarget(commanderDisplay, skill);
                    CheckLastFrameArrowGroupList(list2);
                    CheckAllSkillTarget(list2);
                }
                // 根据玩家点击的地方做显示
                else
                {
                    if (SelectedSkill.Prop.shape_type == Def.ShapeType.Circle)
                    {
                        // 知道玩家点击的位置了,需要根据这个位置得到周围的目标舰船
                        Vector3            targetPosition = (Vector3)SkillSelectParam_;
                        List <TeamDisplay> list3          = SkillTargetSelector.FindSkillTarget(targetPosition, skill);
                        CheckLastFrameArrowGroupList(list3);
                        CheckAllSkillTarget(list3);
                    }
                    else if (SelectedSkill.Prop.shape_type == Def.ShapeType.Default)
                    {
                        TeamDisplay targetDisplay = (TeamDisplay)SkillSelectParam_;
                        if (targetDisplay != null && !targetDisplay.IsDead)
                        {
                            List <TeamDisplay> list4 = new List <TeamDisplay>();
                            list4.Add(targetDisplay);
                            CheckLastFrameArrowGroupList(list4);
                            CheckAllSkillTarget(list4);
                        }
                        else
                        {
                            // 如果目标船死亡了,那么玩家要重新指定一个目标
                            IsSelectedSkillTarget = false;
                        }
                    }
                }
            }
            yield return(null);
        }
    }