Beispiel #1
0
    public void AttemptBuyFuel(int price)
    {
        if (resourceManager.GetGold() >= price)
        {
            // Successful purchase
            fuelManager.Refuel();
            resourceManager.ModifyGold(-price);

            AudioManager.Instance.PlaySFX("Pop2");
            AudioManager.Instance.PlayDialog(AudioManager.DIALOG_FUEL);
        }
        else
        {
            // Insufficient Gold
            AudioManager.Instance.PlayDialog(AudioManager.DIALOG_GOLD);
        }
    }