示例#1
0
    public bool UpdateDonation(int change)
    {
        if (finances.DisplayFunds() < change * donationCenterBuildCost && change > 0)
        {
            return(false);
        }

        donationCenters += change;

        if (change > 0)
        {
            finances.UpdateFunds(-change * donationCenterBuildCost);
        }
        if (change < 0)
        {
            finances.UpdateFunds(-change * donationCenterBuildCost / 2);
        }

        finances.UpdateIncome(change * donationCenterStrength);

        return(true);
    }
示例#2
0
    public void ShipLaunch(GameObject go)
    {
        var launch = go.GetComponent <Launch> ();

        if (launch.GetLaunchCost() > finances.DisplayFunds())
        {
            ErrorTooltip.OpenTooltip("Not enough funds");
            return;
        }

        finances.UpdateFunds(-launch.GetLaunchCost());
        worldPopulation.UpdatePopulation(-launch.GetCapacity());
        finances.UpdateIncome(0);
        Destroy(go);
    }