Example #1
0
    void Controls() //BULLSHIT reikia susitvarkyti ir apgalvoti ar viskas bus ok jei vienu framu pasileistu visos komandos nes nenaudojami else if - galbut reikia debouncing arba kintamuju delayinti veiksma kitam framui
    {
        if (Input.GetButtonDown("Fire"))
        {
            weaponManager.Shoot();
        }
        else if (Input.GetButton("Fire"))
        {
            weaponManager.AutomaticShoot();
        }

        if (Input.GetButtonDown("ThrowGranade"))
        {
            weaponManager.UseExplosive();
        }
        if (Input.GetButtonDown("Reload"))
        {
            Reload();
        }
        if (Input.GetButtonDown("SwitchWeaponRight"))
        {
            weaponManager.SwitchWeaponRight();
        }
        if (Input.GetButtonDown("SwitchWeaponLeft"))
        {
            weaponManager.SwitchWeaponLeft();
        }
        if (Input.GetButtonDown("SwitchGrenadeRight"))
        {
            weaponManager.SwitchExplosiveRight();
        }
        if (Input.GetButtonDown("SwitchGrenadeLeft"))
        {
            weaponManager.SwitchExplosiveLeft();
        }
        if (Input.GetButtonDown("SelectKnife"))
        {
            weaponManager.SelectWeaponByIndex(-1);
        }
    }