Esempio n. 1
0
 public override void OnExit()
 {
     CurrentActor.MainAnim.cullingType = AnimationCullingType.BasedOnRenderers;
     if (CurrentActor.CenterCollider != null)
     {
         CurrentActor.CenterCollider.gameObject.layer = LayerMask.NameToLayer("Actor");
     }
     //将位移动画的位移回馈到角色,并且播放下一个动画,下一个动画不能Fade [8/11/2015 tgame]
     CurrentActor.ApplyAnimationOffset();
 }
Esempio n. 2
0
    public override void OnExit()
    {
        AnimationConfig animConfig = CurrentActor.MainAnim.GetComponent <AnimationConfig>();

        if (null != animConfig && null != animConfig.Trail)
        {
            animConfig.Trail.ClearTrail();
        }
        {
            AttackActionCallback callback = CurrentActor.GetBodyParentObject().GetComponent <AttackActionCallback>();
            callback.enabled = false;
        }
        if (m_skillTarget != null && m_skillTarget != CurrentActor)
        {//面向目标
            Vector3 direction = m_skillTarget.RealPos - CurrentActor.RealPos;
            direction.y = 0;
            // 由于这里修改旋转,会导致Actor的RealPos不正确,所以这里不能乱转 [8/19/2014 tgame]
            //CurrentActor.MoveRotation(Quaternion.LookRotation(direction.normalized) * Quaternion.LookRotation(Vector3.forward));
        }
        m_effectObjList.Clear();
        if (m_skillInfo.IsSlashExist)
        {//显示BoxCollider
            if (CurrentActor.CenterCollider != null)
            {
                CurrentActor.CenterCollider.gameObject.layer = LayerMask.NameToLayer("Actor");
            }
        }
        if (null != CurrentActor.Combo)
        {//设置连接技的信息
            CurrentActor.Combo.SetConnetionInfo(m_skillInfo.SkillConnectionType);
        }

        StopPlaySkillEventAnimation();
        //隐藏body下的所有istrigger状态的collider
        CurrentActor.HideTriggerCollider();

        //停止播放所有武器动作
        CurrentActor.StopPlayWeaponsAnimation();
        //隐藏武器
        CurrentActor.ShowWeaponModelWithTable(false);
        //回馈位移动画
        CurrentActor.ApplyAnimationOffset();
    }
Esempio n. 3
0
 public override void OnExit()
 {
     CurrentActor.MainAnim.cullingType = AnimationCullingType.BasedOnRenderers;
     //回馈位移动画
     CurrentActor.ApplyAnimationOffset();
 }
Esempio n. 4
0
 public override bool OnUpdate()
 {
     if (m_isSwitchRotation)
     {
         float fInterval = RotateForwardTarget();
         if (Mathf.Abs(fInterval) <= GameSettings.Singleton.m_attackRotateMinAngle)
         {
             m_isPlay           = true;
             m_isSwitchRotation = false;
             AnimStartTime      = Time.time;
             AnimLength         = float.MaxValue;
             RefreshActionRef();
         }
         else
         {
             return(false);
         }
     }
     if (!IsFinished)
     {
         PlaySkillEventAnimation();
         PlayMissingSound();
         //if (m_skillInfo.IsStopAttck)
         //{//如果目标死亡,且不在主动僵直中,则停止攻击
         //    if (m_skillTarget != null && m_skillTarget.IsDead)
         //    {//目标死亡
         //        if (!CurrentActor.ActionControl.IsActionRunning(ActorAction.ENType.enSelfSpasticityAction))
         //        {//不在主动僵直中
         //            return true;
         //        }
         //    }
         //}
         if (m_skillInfo.IsCanMove)
         {//移动攻击技能,改为移动攻击action
             AttackStepInfo info = GetAttackStepInfo();
             if (info != null)
             {
                 if (m_skillInfo.IsConductExist && info.m_animName == m_skillInfo.ConductMotion)
                 {//引导动作
                     if (CurrentActor.ActionControl.IsActionRunning(AttackingMoveAction.SGetActionType()))
                     {
                         return(false);
                     }
                     int skillID = m_skillID, targetID = m_skillTargetID;
                     AttackingMoveAction action = CurrentActor.ActionControl.AddAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
                     if (action != null)
                     {
                         action.Init(skillID, targetID);
                         return(false);
                     }
                 }
             }
         }
         if (Time.time - AnimStartTime > AnimLength)
         {//当前动画播放完毕
             //回馈位移动画
             CurrentActor.ApplyAnimationOffset();
             AttackStepInfo info = GetAttackStepInfo();
             if (info != null)
             {     //当前有动画在播放
                 if (m_skillInfo.IsSpellExist && info.m_animName == m_skillInfo.SpellMotion)
                 { //吟唱动作
                     ActionToSpell();
                 }
                 //else if (m_skillInfo.IsSlashExist && info.m_animName == m_skillInfo.SlashMotion)
                 //{//冲刺动作
                 //    //ActionToSlash();
                 //}
                 else if (m_skillInfo.IsConductExist && info.m_animName == m_skillInfo.ConductMotion)
                 {     //引导动作
                     if (m_skillInfo.IsCanMove)
                     { //移动攻击技能,改为移动攻击action
                         int skillID = m_skillID, targetID = m_skillTargetID;
                         AttackingMoveAction action = CurrentActor.ActionControl.AddAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
                         if (action != null)
                         {
                             action.Init(skillID, targetID);
                             return(false);
                         }
                     }
                     else
                     {
                         ActionToConduct();
                     }
                 }
                 else
                 {
                     if (Time.time - AnimStartTime < info.m_animTime)
                     {//播放时间未到,继续播放
                         RefreshActionRef();
                         return(false);
                     }
                     if (info.m_animName == m_skillInfo.ReleaseMotion)
                     {     //释放动作
                         if (m_skillInfo.TargetNumber > 0)
                         { //对多个目标进行释放动作
                             if (m_skillInfo.TargetNumber > SkillTargetIDList.Count)
                             {
                                 m_closestDistance = float.MaxValue;
                                 m_closestTargetID = 0;
                                 ActorManager.Singleton.ForEach(CheckTarget);
                                 if (m_closestTargetID != 0)
                                 {//查找到最近的目标
                                     m_skillTargetID            = m_closestTargetID;
                                     CurrentActor.CurrentTarget = m_skillTarget;
                                     RefreshActionRef();
                                     //因为要播放同一技能步骤下的动作,所以把m_currentType重置
                                     m_currentType = Actor.ENSkillStepType.enNone;
                                     //加入到技能目标id列表中
                                     SkillTargetIDList.Add(m_skillTargetID);
                                     return(false);
                                 }
                             }
                         }
                     }
                     ++m_curAttackStep;
                     if (m_animationNameList.Count <= m_curAttackStep)
                     {//所有动作播放完毕
                         IsFinished = true;
                     }
                     else
                     {
                         m_animBeginTimer = 0;
                         m_animDuration   = 0;
                         RefreshActionRef();
                     }
                 }
             }
             else
             {
                 IsFinished = true;
             }
         }
     }
     if (!CurrentActor.MainRigidBody.isKinematic)
     {
         CurrentActor.MainRigidBody.velocity = Vector3.zero;
     }
     return(IsFinished);
 }