Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        currentTime = 10;
        isFirst     = false;
        foreach (GameObject obj in listPowerUps)
        {
            obj.GetComponent <PowerUp>().currentAdd = 0;
        }

        funcController = gameController.mainShip.GetComponent <FuncController>();
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        mainShip = Instantiate(mainShipPrefab);
        mainShip.transform.position = new Vector3(0, 0, 0);
        mainShip.name = "mainShip";
        mainShip.GetComponent <ShipController>().gameController = this;
        funcController = mainShip.GetComponent <FuncController>();

        listPlanets = new ArrayList();

        ChooseLevel(1);
        SetUpCamera();
        SetUpEnemy();
        SetUpGUI();

        timePlay = 0;
    }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     if (gameController.timePlay < 30)
     {
         if (gameController.timePlay - lastTimeCreateBomber > 8)
         {
             CreateBomber();
             lastTimeCreateBomber = gameController.timePlay;
         }
     }
     else
     {
         FuncController funcController = target.GetComponent <FuncController>();
         if (funcController.GetNumFunc() <= 2)
         {
             if (gameController.timePlay - lastTimeCreateBomber > 8)
             {
                 CreateBomber();
                 lastTimeCreateBomber = gameController.timePlay;
             }
             if (gameController.timePlay - lastTimeCreateShooter > 13)
             {
                 CreateShooter();
                 lastTimeCreateShooter = gameController.timePlay;
             }
         }
         else
         {
             if (gameController.timePlay - lastTimeCreateBomber > 5)
             {
                 CreateBomber();
                 lastTimeCreateBomber = gameController.timePlay;
             }
             if (gameController.timePlay - lastTimeCreateShooter > 10)
             {
                 CreateShooter();
                 lastTimeCreateShooter = gameController.timePlay;
             }
         }
     }
 }
Пример #4
0
 // Use this for initialization
 public void SetUp()
 {
     listFuncState  = new ArrayList();
     funcController = gameController.mainShip.GetComponent <FuncController>();
 }