Beispiel #1
0
        public override void Start()
        {
            base.Start();

            m_MoveState   = new List <Vector3> (MoveRecordCount);
            m_MoveRequest = new List <Vector3> (MoveRequestCount);

            gMainPlayer = this;
            gameObject.AddComponent <Scanner> ();
            mMove      = Entity.GetCmpt <Motion_Move_Human> ();
            mEquip     = Entity.motionEquipment;
            mView      = Entity.biologyViewCmpt;
            mTrans     = Entity.peTrans;
            mIK        = Entity.GetCmpt <IKCmpt> ();
            m_Skill    = Entity.aliveEntity;
            mPackage   = Entity.GetCmpt <PackageCmpt> ();
            mPassenger = Entity.passengerCmpt;
            mMotionMgr = Entity.motionMgr;
            mMotionMgr.onActionStart += OnActionStart;
            mMotionMgr.onActionEnd   += OnActionEnd;
            m_Abnormalcmpt            = Entity.Alnormal;

            if (null != m_Abnormalcmpt)
            {
                m_Abnormalcmpt.evtStart += OnStartAbnormal;
                m_Abnormalcmpt.evtEnd   += OnEndAbnormal;
            }

            if (null != m_Skill)
            {
                m_Skill.onHpReduce     += OnDamage;
                m_Skill.attackEvent    += OnAttack;
                m_Skill.deathEvent     += OnDeath;
                m_Skill.onSkillEvent   += OnSkillTarget;
                m_Skill.onWeaponAttack += OnWeaponAttack;

                m_Skill.OnBeEnemyEnter += OnBeEnemyEnter;
            }

            if (!PeGameMgr.IsTutorial)
            {
                StartCoroutine(UpdateAbnormalNotice());
            }

            //历险模式下此时初始化声望系统,ForceSetting并未加载,会导致声望系统不能正常起作用
            //InitReputationSystem();
            Invoke("CheckAbnormalState", 5f);
        }
Beispiel #2
0
        public override void Start()
        {
            base.Start();
            mSkEntity    = Entity.skEntity;
            mViewCmpt    = Entity.biologyViewCmpt;
            mNPC         = Entity.NpcCmpt;
            mMotionEquip = Entity.motionEquipment;
            if (null != m_InitItems && m_InitItems.Count > 0)
            {
                for (int i = 0; i < m_InitItems.Count; ++i)
                {
                    PutOnEquipment(m_InitItems[i]);
                }
                m_InitItems.Clear();
                Entity.lodCmpt.onConstruct += e => e.StartCoroutine(PreLoad());
            }
//			StartCoroutine(InitEquipment());
        }
        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);
        }