コード例 #1
0
ファイル: SkillTargetSelector.cs プロジェクト: LynnPi/OF
    private static bool IsInSkillRange(Transform trans1, TeamDisplay ship2, proto.SkillReference reference)
    {
        int       vol    = ship2.GetShip().Reference.vol;
        Transform trans2 = ship2.GetTeamGo().transform;

        return(IsInSkillRange(trans1, trans2, reference, vol));
    }
コード例 #2
0
ファイル: SkillTargetSelector.cs プロジェクト: LynnPi/OF
    /// <summary>
    /// ship是否在pos为圆心的范围内
    /// </summary>
    /// <param name="pos"></param>
    /// <param name="ship"></param>
    /// <param name="skill"></param>
    /// <returns></returns>
    private static bool IsInSkillRange(Vector3 pos, TeamDisplay ship, ClientSkill skill)
    {
        proto.SkillReference reference = skill.Prop;
        int shapType = reference.shape_type;

        if (shapType != Def.ShapeType.Circle)
        {
            return(false);
        }
        int angle = 360;
        int range = reference.aoe_range;
        int vol   = ship.GetShip().Reference.vol;

        return(IsInSector(pos, ship.GetTeamGo().transform, angle, range, vol));
    }
コード例 #3
0
ファイル: SkillTargetSelector.cs プロジェクト: LynnPi/OF
    /// <summary>
    /// 根据技能配置,距离,角度得到最终的目标表
    /// </summary>
    /// <param name="shipTrans"></param>
    /// <param name="skill"></param>
    /// <returns></returns>
    public static List <TeamDisplay> FindSkillTarget(TeamDisplay ship, ClientSkill skill)
    {
        // 目标表
        List <TeamDisplay> result = new List <TeamDisplay>();

        if (skill.Prop.cast_target_type != Def.CastTargetType.Self)
        {
            Dictionary <int, TeamDisplay> playerList = BattleSceneDisplayManager.Instance.GetTeamDisplayList(true);
            Dictionary <int, TeamDisplay> enemyList  = BattleSceneDisplayManager.Instance.GetTeamDisplayList(false);
            result.AddRange(FindSkillTarget(ship.GetTeamGo().transform, skill, playerList, enemyList));
        }
        else
        {
            result.Add(ship);
        }
        return(result);
    }
コード例 #4
0
    /// <summary>
    /// 显示trans所属队伍的选中状态,关闭所属队伍列表内其他队伍的选中状态
    /// </summary>
    /// <param name="trans"></param>
    private void ShowSelect(Transform trans)
    {
        if (trans == null)
        {
            return;
        }
        Dictionary <int, TeamDisplay> teamList = GetTeamDisplayList(trans);
        TeamDisplay display = GetTeamDisplay(trans);

        if (display == null)
        {
            return;
        }
        ResetSelect(teamList, display.IsPlayerShip());
        display.SetSelect(true);
        if (!display.IsPlayerShip())
        {
            return;
        }
        GameObject teamGo = display.GetTeamGo();

        if (teamGo == null)
        {
            return;
        }
        Transform  teamGoTrans = teamGo.transform;
        ClientShip ship        = display.GetShip();
        float      vol         = ship.Reference.vol;

        if (SelectedPlayerShipArrowGroup_ == null)
        {
            SelectedPlayerShipArrowGroup_ = BattleArrowGroup.InitArrowGroup(teamGoTrans, vol, false);
        }
        else
        {
            SelectedPlayerShipArrowGroup_.ChangeParent(teamGoTrans, vol);
        }
    }
コード例 #5
0
ファイル: SkillTargetSelector.cs プロジェクト: LynnPi/OF
    /// <summary>
    /// ship2是否在ship1的技能范围内
    /// </summary>
    /// <param name="ship1"></param>
    /// <param name="ship2"></param>
    /// <param name="skill"></param>
    /// <returns></returns>
    private static bool IsInSkillRange(TeamDisplay ship1, TeamDisplay ship2, ClientSkill skill)
    {
        Transform trans1 = ship1.GetTeamGo().transform;

        return(IsInSkillRange(trans1, ship2, skill));
    }