public void Initialize() { // 默认装备,可以在后续修改其对象 EnemyMono = Enemy.GameObjectInScene.GetComponent <IEnemyMono>(); if (EnemyMono != null) { EnemyMono.EnemyMedi = this; EnemyMono.AnimatorComponent = Enemy.animator; EnemyMono.Rgbd = Enemy.Rgbd; EnemyMono.BdTree = Enemy.bt; EnemyMono.NavMeshAgentComponent = Enemy.navMeshAgent; EnemyWeapon = EnemyMono.iEnemyWeapon; EnemyMono.Initialize(); if (EnemyWeapon != null) { EnemyWeapon.EnemyMedi = this; EnemyWeapon.Initialize(); EnemyMono.WeaponCollider = EnemyWeapon.WeaponCollider; } else { Debug.LogError("iEnemyWeapon未赋值"); } } UpdateEnemyWeapon(EnemyMono.iEnemyWeapon); }