Пример #1
0
        public override void Start()
        {
            base.Start();

            m_Animator = GetComponent <AnimatorCmpt>();
            if (m_Animator != null)
            {
                m_Animator.SetInteger("Owner", OwnerID);
                m_Animator.SetInteger("Sex", (int)sex);
            }
        }
Пример #2
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;
            }
        }
Пример #3
0
        public override void Start()
        {
            base.Start();
            m_SpeedState = SpeedState.None;
            m_PeTrans    = Entity.peTrans;
            m_Animator   = Entity.GetCmpt <AnimatorCmpt>();
            m_Attribute  = Entity.GetCmpt <SkAliveEntity>();
            m_target     = GetComponent <TargetCmpt>();
            //m_Limiter = new MovementLimiter(this, m_Field);

            if (m_Attribute != null)
            {
                m_Attribute.deathEvent += OnDeath;
            }
        }
Пример #4
0
        void Start()
        {
            if (!m_Init)
            {
                InitSkEntity();
            }

            Entity.AddMsgListener(this);

            m_CollisionEntities = new Dictionary <Collider, List <Collider> >();

            m_View        = Entity.viewCmpt;
            m_Trans       = Entity.peTrans;
            m_Animator    = Entity.animCmpt;
            m_Beat        = Entity.GetCmpt <Motion_Beat>();
            m_MotionMgr   = Entity.motionMgr;
            m_MotionEquip = Entity.GetCmpt <Motion_Equip>();
            m_Live        = Entity.GetCmpt <Motion_Live>();
            onHpChange   += OnHpChange;
            onSkillEvent += OnTargetSkill;
            onTranslate  += OnTranslate;
            Invoke("CheckInitAttr", 0.5f);
        }
Пример #5
0
        void InitAction()
        {
            m_Trans = Entity.peTrans;
            m_Skill = Entity.aliveEntity;
            m_Skill.onSheildReduce += OnSheildReduce;
            m_View      = Entity.biologyViewCmpt;
            m_EquipCmpt = Entity.equipmentCmpt;
            m_Package   = Entity.packageCmpt;
            m_NPC       = Entity.NpcCmpt;
            m_Anim      = Entity.animCmpt;
            m_MotionMgr = Entity.motionMgr;
            Invoke("CheckGloves", 0.5f);

            m_HeavyEquipmentCtrl.moveCmpt  = Entity.motionMove as Motion_Move_Human;
            m_HeavyEquipmentCtrl.ikCmpt    = Entity.IKCmpt;
            m_HeavyEquipmentCtrl.motionMgr = m_MotionMgr;

//			m_ChainSawActive.anim = anim;
            m_SwordAttack.m_UseStamina         = isMainPlayer;
            m_TwoHandWeaponAttack.m_UseStamina = isMainPlayer;
            //Gun
            m_GunFire.m_gunHold = m_GunHold;

            m_HandChangeHold.onActiveEvt   += OnActiveEquipment;
            m_HandChangeHold.onDeactiveEvt += OnDeactiveEquipment;

            m_TwoHandWeaponHold.onActiveEvt   += OnActiveEquipment;
            m_TwoHandWeaponHold.onDeactiveEvt += OnDeactiveEquipment;

            m_GunHold.onActiveEvt   += OnActiveEquipment;
            m_GunHold.onDeactiveEvt += OnDeactiveEquipment;

            m_BowHold.onActiveEvt   += OnActiveEquipment;
            m_BowHold.onDeactiveEvt += OnDeactiveEquipment;

            m_AimEquipHold.onActiveEvt   += OnActiveEquipment;
            m_AimEquipHold.onDeactiveEvt += OnDeactiveEquipment;

            if (null != m_MotionMgr)
            {
                m_MotionMgr.onActionEnd += OnActionEnd;
                m_MotionMgr.AddAction(m_HandChangeHold);
                m_MotionMgr.AddAction(m_HandChangePutOff);
                m_MotionMgr.AddAction(m_SwordAttack);
                m_MotionMgr.AddAction(m_TwoHandWeaponHold);
                m_MotionMgr.AddAction(m_TwoHandWeaponPutOff);
                m_MotionMgr.AddAction(m_TwoHandWeaponAttack);
                m_MotionMgr.AddAction(m_SheildHold);
                m_MotionMgr.AddAction(m_GunHold);
                m_MotionMgr.AddAction(m_GunPutOff);
                m_MotionMgr.AddAction(m_GunFire);
                m_MotionMgr.AddAction(m_GunReload);
                m_MotionMgr.AddAction(m_GunMelee);
                m_MotionMgr.AddAction(m_BowHold);
                m_MotionMgr.AddAction(m_BowPutOff);
                m_MotionMgr.AddAction(m_BowShoot);
                m_MotionMgr.AddAction(m_BowReload);
                m_MotionMgr.AddAction(m_AimEquipHold);
                m_MotionMgr.AddAction(m_AimEquipPutOff);
                m_MotionMgr.AddAction(m_DigTerrain);
                m_MotionMgr.AddAction(m_Fell);
                m_MotionMgr.AddAction(m_JetPackAction);
                m_MotionMgr.AddAction(m_ParachuteAction);
                m_MotionMgr.AddAction(m_GliderAction);
                m_MotionMgr.AddAction(m_DrawWater);
                m_MotionMgr.AddAction(m_PumpWater);
                m_MotionMgr.AddAction(m_ThrowGrenade);
                m_MotionMgr.AddAction(m_FlashLightAction);
                m_MotionMgr.AddAction(m_RopeGunAction);
            }
        }