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); }
public override void Start() { base.Start(); cmptIK = Entity.GetCmpt <IKCmpt>(); cmptCommon = GetComponent <CommonCmpt>(); cmptEquipment = GetComponent <EquipmentCmpt>(); Entity.aliveEntity.deathEvent += OnDeath; Entity.aliveEntity.reviveEvent += OnRevive; //there is no scene event if (SceneMan.self == null) { this.Invoke(0.1f, Build); } }