Пример #1
0
    void Update()
    {
        if (!gameOver)
        {
            if (paused)
            {
                return;
            }
            pilot.MoveShip(gameObject);

            if (pilot is UserPilot && Input.GetMouseButton(0))
            {
                if (fireBullets)
                {
                    if (tier == 1)
                    {
                        pilot.Fire(gameObject, bullet.gameObject, bulletPool);
                    }

                    else if (tier == 2)
                    {
                        pilot.Fire(gameObject, bullet.gameObject, bulletPool);
                    }

                    else if (tier == 3)
                    {
                        pilot.Fire(gameObject, bullet.gameObject, bulletPool);
                    }

                    else if (tier == 4 || tier == 5)
                    {
                        pilot.Fire(gameObject, bullet.gameObject, bulletPool);
                    }

                    fireBullets = false;
                    StartCoroutine(Countdown());
                }
            }

            if (pilot is AIPilot)
            {
                pilot.Fire(gameObject, bullet, bulletPool);
            }
        }
    }