public IEnemy(GameObject gameObject) : base(gameObject) { if (GameObjectInScene != null) { animator = GameObjectInScene.GetComponent <Animator>(); Rg2d = GameObjectInScene.GetComponent <Rigidbody2D>(); // 关联中介者 EnemyMedi = new EnemyMediator(this); EnemyMedi.Initialize(); } }
public IEnemy(GameObject gameObject) : base(gameObject) { Type = EnemyType.Monster; if (GameObjectInScene != null) { animator = GameObjectInScene.GetComponent <Animator>(); Rgbd = GameObjectInScene.GetComponent <Rigidbody>(); bt = GameObjectInScene.GetComponent <BehaviorTree>(); navMeshAgent = GameObjectInScene.GetComponent <NavMeshAgent>(); // 关联中介者 EnemyMedi = new EnemyMediator(this); EnemyMedi.Initialize(); } }