Esempio n. 1
0
        /// <summary>
        /// 初始化驯服数据
        /// </summary>
        private void InitTameData(PeEntity master)
        {
            if (!Entity)
            {
                return;
            }

            m_Move   = Entity.motionMove as Motion_Move_Motor;
            m_Master = master;
            SetctrlType(ECtrlType.Free);

            if (!m_SkillData.canUse())
            {
                m_SkillData.Reset(MountsSkillDb.GetRandomSkill(Entity.ProtoID, MountsSkillKey.Mskill_L),
                                  MountsSkillDb.GetRandomSkill(Entity.ProtoID, MountsSkillKey.Mskill_Space),
                                  MountsSkillDb.GetRandomSkill(Entity.ProtoID, MountsSkillKey.Mskill_pounce)
                                  );
            }

            m_PlayerForceDb = new ForceData((int)m_Master.GetAttribute(AttribType.CampID), (int)m_Master.GetAttribute(AttribType.DamageID), (int)m_Master.GetAttribute(AttribType.DefaultPlayerID));
            if (m_MountsForceDb == null)
            {
                m_MountsForceDb = new ForceData((int)Entity.GetAttribute(AttribType.CampID), (int)Entity.GetAttribute(AttribType.DamageID), (int)Entity.GetAttribute(AttribType.DefaultPlayerID));
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        private void EndMount()
        {
            m_Move = null;
            m_Init = false;
            SetctrlType(ECtrlType.Free);
            if (Entity.target)
            {
                Entity.target.ClearEnemy();
            }

            Pathea.FastTravelMgr.Instance.OnFastTravel -= OnFastTravel;
            DelEvent(Entity);
        }
Esempio n. 3
0
        public override void Awake()
        {
            base.Awake();
            m_Animator = GetComponent <AnimatorCmpt>();
            m_SkEntity = GetComponent <SkAliveEntity>();
            m_Behave   = GetComponent <BehaveCmpt>();
            m_Motor    = GetComponent <Motion_Move_Motor>();
            m_Trans    = GetComponent <PeTrans>();
            m_Request  = GetComponent <RequestCmpt>();

            if (m_SkEntity != null)
            {
                m_SkEntity.deathEvent += OnDeath;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 初始化坐骑数据(被驯服后数据)
        /// </summary>
        private bool InitMountData()
        {
            if (!Entity)
            {
                return(false);
            }

            m_Move = Entity.motionMove as Motion_Move_Motor;
            m_Move.Stop();

            SetctrlType(ECtrlType.Mount);
            Pathea.FastTravelMgr.Instance.OnFastTravel += OnFastTravel;

            m_PlayerForceDb = new ForceData((int)m_Master.GetAttribute(AttribType.CampID), (int)m_Master.GetAttribute(AttribType.DamageID), (int)m_Master.GetAttribute(AttribType.DefaultPlayerID));

            if (m_MountsForceDb == null)
            {
                m_MountsForceDb = new ForceData((int)Entity.GetAttribute(AttribType.CampID), (int)Entity.GetAttribute(AttribType.DamageID), (int)Entity.GetAttribute(AttribType.DefaultPlayerID));
            }

            if (!m_SkillData.canUse())
            {
                m_SkillData.Reset(MountsSkillDb.GetRandomSkill(Entity.ProtoID, MountsSkillKey.Mskill_L),
                                  MountsSkillDb.GetRandomSkill(Entity.ProtoID, MountsSkillKey.Mskill_Space),
                                  MountsSkillDb.GetRandomSkill(Entity.ProtoID, MountsSkillKey.Mskill_pounce)
                                  );
            }

            StartMountsForceDb();
            DispatchEvent(Entity);

            //lw:2017.3.13:读档后如果在晚上,怪物不能结束睡觉动作
            if (Entity.animCmpt != null)
            {
                Entity.animCmpt.SetBool("Sleep", false);
            }

            m_Init = true;
            return(true);
        }
Esempio n. 5
0
 public MovementLimiter(Motion_Move_Motor motor, MovementField movementField)
 {
     m_MotionMove    = motor;
     m_Trans         = m_MotionMove.GetComponent <PeTrans>();
     m_MovementField = movementField;
 }