Пример #1
0
 public IEnemy(GameObject gameObject) : base(gameObject)
 {
     if (GameObjectInScene != null)
     {
         animator = GameObjectInScene.GetComponent <Animator>();
         Rg2d     = GameObjectInScene.GetComponent <Rigidbody2D>();
         // 关联中介者
         EnemyMedi = new EnemyMediator(this);
         EnemyMedi.Initialize();
     }
 }
Пример #2
0
 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();
     }
 }