Example #1
0
    void OnTouchStay()
    {
//      Mikäli tagilla olevaa nappia painetaan pohjassa -> suoritetaan inputcontrollien komentoja
        if (gameObject.tag == "Left")
        {
            inputControls.TurnShip(-1f);
        }

        if (gameObject.tag == "Right")
        {
            inputControls.TurnShip(1f);
        }

        if (gameObject.tag == "Gas")
        {
            inputControls.MoveShip();
        }

        if (gameObject.tag == "ShootLeft" && Time.time > inputControls.nextFire)
        {
            inputControls.playerShoot("vasen");
        }

        if (gameObject.tag == "ShootRight" && Time.time > inputControls.nextFire)
        {
            inputControls.playerShoot("oikea");
        }

        if (gameObject.tag == "Quit")
        {
            ExitGame();
        }

        if (gameObject.tag == "Restart")
        {
            reStart();
        }
    }