Beispiel #1
0
        public override void DoAction(PEActionParam para = null)
        {
            m_ClimbDir = 0;
            motionMgr.SetMaskState(PEActionMask.Climb, true);
            if (null != trans)
            {
                PEActionParamVQN paramVQN            = para as PEActionParamVQN;
                Quaternion       ladderRot           = paramVQN.q;
                ItemScript_ClimbLadder.OpSide opSide = (ItemScript_ClimbLadder.OpSide)paramVQN.n;
                switch (opSide)
                {
                case ItemScript_ClimbLadder.OpSide.Both:
                    if (Vector3.Angle(trans.forward, ladderRot * Vector3.forward) > 90)
                    {
                        trans.rotation = Quaternion.AngleAxis(180f, Vector3.up) * ladderRot;
                    }
                    else
                    {
                        trans.rotation = ladderRot;
                    }
                    break;

                case ItemScript_ClimbLadder.OpSide.Backward:
                    trans.rotation = Quaternion.AngleAxis(180f, Vector3.up) * ladderRot;
                    break;

                case ItemScript_ClimbLadder.OpSide.Forward:
                    trans.rotation = ladderRot;
                    break;
                }
                trans.position = paramVQN.vec;
            }
            if (null != anim)
            {
                anim.ResetTrigger("ResetFullBody");
                anim.ResetTrigger("LadderUpEnd");
                anim.SetTrigger("LadderClimb");
            }
            motionMgr.FreezePhyState(GetType(), true);
            if (null != m_PhyCtrl)
            {
                m_PhyCtrl.velocity = Vector3.zero;
                m_PhyCtrl.CancelMoveRequest();
            }
            if (null != ikCmpt)
            {
                ikCmpt.ikEnable = false;
            }
            m_EndClimb = false;
        }
Beispiel #2
0
        public override void DoAction(PEActionParam para = null)
        {
            PEActionParamVQNS paramVQNS = para as PEActionParamVQNS;

            if (null != trans)
            {
                m_StartPos       = trans.position;
                m_StartRot       = trans.rotation;
                m_TargetPos      = paramVQNS.vec;
                m_TargetRot      = paramVQNS.q;
                m_MoveElapseTime = 0;
            }
            m_AnimName = paramVQNS.str;
            if (null != anim)
            {
                anim.SetBool(m_AnimName, true);
                anim.ResetTrigger("ResetFullBody");
            }


            m_BuffID = paramVQNS.n;

            if (null != skillCmpt && 0 != m_BuffID)
            {
                SkAliveEntity.MountBuff(skillCmpt, m_BuffID, new System.Collections.Generic.List <int>(), new System.Collections.Generic.List <float>());
            }

            m_EndAnim   = false;
            m_EndAction = false;

            if (null != ikCmpt)
            {
                ikCmpt.ikEnable = false;
            }

            if (null != m_PhyCtrl)
            {
                m_PhyCtrl.velocity = Vector3.zero;
                m_PhyCtrl.CancelMoveRequest();
            }

            if (null != startSleepEvt)
            {
                startSleepEvt(m_BuffID);
            }
        }