Esempio n. 1
0
    /// <summary>
    /// 创建被攻击者位置改变表现
    /// </summary>
    /// <param name="beAttackId"></param>
    /// <param name="fStartTime"></param>
    /// <param name="data"></param>
    /// <param name="fAnimEndTime"></param>
    /// <returns></returns>
    private float BuildBeAttackPosChangeShow(long beAttackId, float fStartTime, DataSkillShow data, ref float fAnimEndTime)
    {
        float   allTime     = fStartTime;
        float   delayTime   = data == null ? 0f : data.BeAttackJumpStartDelayTime;
        Vector3 vec3DestPos = (this.BeAttackPosList.Count > 0) ? Hexagon.GetHex3DPos(this.BeAttackPosList[0], Space.World) : Vector3.zero;
        float   hitTime     = SkillGameManager.GetSkillHitTime(this.SkillId, this.AttackerId, beAttackId, vec3DestPos, EffectInstanceType.Trace);

        if (this.BeAttackerPosChanges.ContainsKey(beAttackId))
        {
            foreach (var current in this.BeAttackerPosChanges[beAttackId])
            {
                ChangePosTrigger trigger = new ChangePosTrigger();
                trigger.SkillId              = this.SkillId;
                trigger.TargetPlayerID       = this.AttackerId;
                trigger.controlData.type     = current.type;
                trigger.controlData.PlayerId = current.PlayerId;
                trigger.controlData.DestPos.AddRange(current.DestPos);
                trigger.IsForward = SkillGameManager.IsBeAttackForward(this.SkillId);
                if (null != data)
                {
                    trigger.JumpEndAnim  = data.BeAttackJumpEndAnim;
                    trigger.JumpDuraAnim = data.BeAttackJumpDuraAnim;
                    if (current.type == ChangePosType.e_Jump)
                    {
                        trigger.Jumptime = ((data.BeAttackJumpSpeed <= 0f) ? data.BeAttackJumpTime : (this.GetDistanceByPos(current.DestPos[0]) / data.BeAttackJumpSpeed));
                        trigger.Height   = data.BeAttackJumpHeight;
                        trigger.EffectId = data.BeAttackJumpEffect;
                    }
                    else if (current.type == ChangePosType.e_Walk)
                    {
                        trigger.EffectId = data.BeAttackJumpEffect;
                    }
                }
                trigger.StartTime = allTime + delayTime + hitTime;
                trigger.Duration  = trigger.GetDuration();
                base.AddEvent(trigger);
                allTime      = trigger.StartTime + trigger.Duration;
                fAnimEndTime = allTime;
            }
        }
        return(allTime);
    }