Beispiel #1
0
 void Update( )
 {
     if (Input.GetKeyDown(KeyCode.U))
     {
         EnemyShip ship = factory.MakeEnemyShip(EnemyShipFactory.ShipType.UFO);
         DoStuffEnemy(ship);
     }
     else if (Input.GetKeyDown(KeyCode.R))
     {
         EnemyShip ship = factory.MakeEnemyShip(EnemyShipFactory.ShipType.Rocket);
         DoStuffEnemy(ship);
     }
     else if (Input.GetKeyDown(KeyCode.B))
     {
         EnemyShip ship = factory.MakeEnemyShip(EnemyShipFactory.ShipType.Endboss);
         DoStuffEnemy(ship);
     }
 }
Beispiel #2
0
 void DoStuffEnemy(EnemyShip enemyShip)
 {
     enemyShip.displayEnemyShip();
     enemyShip.followHeroShip();
     enemyShip.enemyShipShoots();
 }