コード例 #1
0
ファイル: MainStage.cs プロジェクト: githuanl/NewBeastGame
    /// <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);
    }
コード例 #2
0
ファイル: MainStage.cs プロジェクト: githuanl/NewBeastGame
    /// <summary>
    /// 创建攻击者位置改变表现
    /// </summary>
    /// <param name="fStartTime"></param>
    /// <param name="fAnimEndTime"></param>
    /// <param name="dataSkillShow"></param>
    /// <returns></returns>
    private float BuildAttackPosChangeShow(float fStartTime, ref float fAnimEndTime, DataSkillShow dataSkillShow)
    {
        float time      = fStartTime;
        float delayTime = dataSkillShow == null ? 0f : dataSkillShow.AttackJumpStartDelayTime;

        foreach (var current in this.AttackerPosChanges)
        {
            ChangePosTrigger trigger = new ChangePosTrigger();
            trigger.controlData = current;
            trigger.StartTime   = time + delayTime;
            if (dataSkillShow != null)
            {
                trigger.JumpEndAnim  = dataSkillShow.AttackJumpEndAnim;
                trigger.JumpDuraAnim = dataSkillShow.AttackJumpDuraAnim;
                if (current.type == ChangePosType.e_Jump)
                {
                    trigger.Jumptime = ((dataSkillShow.AttackJumpSpeed <= 0f) ? dataSkillShow.AttackJumpTime : (this.GetDistanceByPos(current.DestPos[0]) / dataSkillShow.AttackJumpSpeed));
                    trigger.EffectId = dataSkillShow.AttackJumpEffect;
                    trigger.Height   = dataSkillShow.AttackJumpHeight;
                }
                else if (current.type == ChangePosType.e_Walk)
                {
                    trigger.EffectId = dataSkillShow.AttackJumpEffect;
                }
            }
            trigger.Duration  = trigger.GetDuration();
            trigger.SkillId   = this.SkillId;
            trigger.IsForward = SkillGameManager.IsAttackForward(this.SkillId);
            if (!current.IgnoreDuration)
            {
                time         = trigger.StartTime + trigger.Duration + 0.1f;
                fAnimEndTime = time;
            }
            if (this.BeAttackerList.Count > 0 && this.AttackerId != this.BeAttackerList[0])
            {
                trigger.TargetPlayerID = this.BeAttackerList[0];
            }
            base.AddEvent(trigger);
        }
        return(time);
    }