コード例 #1
0
    // 指向性技能输入:妲己二技能
    private AbilityInput CreateAbilityTargetInput(AbilityBehavior abilityBehavior)
    {
        var abilityInput = new AbilityInputPoint(m_casterTransform, ability);
        var trans        = GetIndicatorAsset(AbilityIndicatorType.RANGE_AREA);
        AbilityIndicatorRange abilityIndicatorRange = new AbilityIndicatorRange(trans, m_casterTransform, ability.GetCastRange());

        trans = GetIndicatorAsset(AbilityIndicatorType.SEGMENT);
        AbilityIndicatorSegment abilityIndicatorSegment = new AbilityIndicatorSegment(trans, m_casterTransform);
        var radius = ability.GetAbilityAOERadius();

        trans = GetIndicatorAsset(AbilityIndicatorType.SEGMENT_AREA);
        AbilityIndicatorPoint abilityIndicatorPoint = new AbilityIndicatorPoint(trans, m_casterTransform, radius);

        abilityInput.AddAbilityIndicator(abilityIndicatorRange);
        abilityInput.AddAbilityIndicator(abilityIndicatorSegment);
        abilityInput.AddAbilityIndicator(abilityIndicatorPoint);
        return(abilityInput);
    }
コード例 #2
0
    // 点施法类型,王昭君大招
    private AbilityInput CreateAbilityPointInput(AbilityBehavior abilityBehavior)
    {
        var abilityInput = new AbilityInputPoint(m_casterTransform, ability);

        if ((abilityBehavior & AbilityBehavior.ABILITY_BEHAVIOR_RADIUS_AOE) != 0)
        {
            var radius = ability.GetAbilityAOERadius();
            var trans  = GetIndicatorAsset(AbilityIndicatorType.RANGE_AREA);
            AbilityIndicatorRange abilityIndicatorRange = new AbilityIndicatorRange(trans, m_casterTransform, ability.GetCastRange());
            trans = GetIndicatorAsset(AbilityIndicatorType.CIRCLE_AREA);
            AbilityIndicatorPoint abilityIndicatorPoint = new AbilityIndicatorPoint(trans, m_casterTransform, radius);

            abilityInput.AddAbilityIndicator(abilityIndicatorRange);
            abilityInput.AddAbilityIndicator(abilityIndicatorPoint);
        }
        else
        {
            BattleLog.LogError("技能[{0}]中有未定义的Point类型技能区域", ability.GetConfigName());
        }

        return(abilityInput);
    }
コード例 #3
0
    // 非指向性技能输入,妲己一技能
    private AbilityInput CreateAbilityNoTargetInput(AbilityBehavior abilityBehavior)
    {
        AbilityInput          abilityInput;
        AbilityIndicatorRange abilityIndicatorRange;
        var rangeTrans = GetIndicatorAsset(AbilityIndicatorType.RANGE_AREA);

        // 直线型
        if ((abilityBehavior & AbilityBehavior.ABILITY_BEHAVIOR_DIRECTIONAL) != 0)
        {
            abilityInput = new AbilityInputDirection(m_casterTransform, ability);
            var castRange = ability.GetCastRange();
            abilityIndicatorRange = new AbilityIndicatorRange(rangeTrans, m_casterTransform, castRange);
            var   trans = GetIndicatorAsset(AbilityIndicatorType.LINE_AREA);
            float lineLength, lineThickness;
            ability.GetLineAoe(out lineLength, out lineThickness);
            AbilityIndicatorLine abilityIndicatorLine = new AbilityIndicatorLine(trans, m_casterTransform, lineLength, lineThickness);
            abilityInput.AddAbilityIndicator(abilityIndicatorRange);
            abilityInput.AddAbilityIndicator(abilityIndicatorLine);
            return(abilityInput);
        }

        // 扇形型
        if ((abilityBehavior & AbilityBehavior.ABILITY_BEHAVIOR_SECTOR_AOE) != 0)
        {
            abilityInput = new AbilityInputDirection(m_casterTransform, ability);
            AbilityIndicatorType abilityIndicatorType;
            float sectorRadius, sectorAngle;
            ability.GetSectorAoe(out sectorRadius, out sectorAngle);
            if (sectorAngle == 60)
            {
                abilityIndicatorType = AbilityIndicatorType.SECTOR60_AREA;
            }
            else if (sectorAngle == 90)
            {
                abilityIndicatorType = AbilityIndicatorType.SECTOR90_AREA;
            }
            else if (sectorAngle == 120)
            {
                abilityIndicatorType = AbilityIndicatorType.SECTOR120_AREA;
            }
            else
            {
                BattleLog.LogError("技能[{0}]中有未定义的扇形AOE范围角度[{1}]", ability.GetConfigName(), sectorAngle);
                return(null);
            }

            var castRange = ability.GetCastRange();
            abilityIndicatorRange = new AbilityIndicatorRange(rangeTrans, m_casterTransform, castRange);

            var trans = GetIndicatorAsset(abilityIndicatorType);
            var abilityIndicatorSector = new AbilityIndicatorLine(trans, m_casterTransform, sectorRadius, sectorRadius);

            abilityInput.AddAbilityIndicator(abilityIndicatorRange);
            abilityInput.AddAbilityIndicator(abilityIndicatorSector);
            return(abilityInput);
        }

        // 范围型AOE 和 普通攻击,可以原地平A
        abilityInput          = new AbilityInputDirection(m_casterTransform, ability);
        abilityIndicatorRange = new AbilityIndicatorRange(rangeTrans, m_casterTransform, ability.GetCastRange());
        abilityInput.AddAbilityIndicator(abilityIndicatorRange);

        return(abilityInput);
    }