Esempio n. 1
0
        void OnEndAction()
        {
            if (null != skillCmpt && null != m_SkillInst && skillCmpt.IsSkillRunning(m_SkillInst.SkillID))
            {
                skillCmpt.CancelSkillById(m_SkillInst.SkillID);
            }

            motionMgr.SetMaskState(PEActionMask.SwordAttack, false);
            m_WaitInput       = false;
            m_TstAttack       = false;
            m_SkillInst       = null;
            m_AttackTargetDir = Vector3.zero;

            if (null != phyMotor)
            {
                phyMotor.CancelMoveRequest();
                phyMotor.desiredMovementDirection = Vector3.zero;
            }

            if (null != m_AttackTrigger)
            {
                m_AttackTrigger.ClearHitInfo();
                m_AttackTrigger.onHitTrigger -= OnHitTrigger;
                m_AttackTrigger.active        = false;
                m_AttackTrigger = null;
            }
            else if (null != m_AttackCol)
            {
                m_AttackCol.enabled = false;
                m_AttackCol         = null;
            }

            if (null != ikCmpt)
            {
                ikCmpt.aimActive = false;
                if (null != ikCmpt.m_IKAimCtrl)
                {
                    ikCmpt.m_IKAimCtrl.EndSyncAimAxie();
                }
            }

            anim.speed = 1f;

            DestroyEffect();
        }
Esempio n. 2
0
 void ActiveCol(string colName)
 {
     if (null != anim.animator)
     {
         Transform trans = PETools.PEUtil.GetChild(anim.animator.transform, colName);
         if (null != trans)
         {
             PEAttackTrigger findTrigger = trans.GetComponent <PEAttackTrigger>();
             if (null != findTrigger)
             {
                 if (null != m_AttackTrigger)
                 {
                     if (findTrigger != m_AttackTrigger)
                     {
                         m_AttackTrigger.ClearHitInfo();
                         m_AttackTrigger.onHitTrigger -= OnHitTrigger;
                         m_AttackTrigger.active        = false;
                         m_AttackTrigger = findTrigger;
                         m_AttackTrigger.onHitTrigger += OnHitTrigger;
                         m_AttackTrigger.active        = true;
                     }
                     else
                     {
                         m_AttackTrigger.ResetHitInfo();
                         m_AttackTrigger.active = true;
                     }
                 }
                 else
                 {
                     m_AttackTrigger = findTrigger;
                     m_AttackTrigger.onHitTrigger += OnHitTrigger;
                     m_AttackTrigger.active        = true;
                 }
             }
             else
             {
                 m_AttackCol = trans.GetComponent <Collider>();
                 if (null != m_AttackCol)
                 {
                     m_AttackCol.enabled = true;
                 }
             }
         }
     }
 }