Beispiel #1
0
    public void BuyMineExpansion(MiningShaft thisMiningshaft)
    {
        Button thisButton = thisMiningshaft.expandMiningShaftButton;

        if (thisMiningshaft.expansionLevel == 0)
        {
            if (CheckAffordability(mineExpansion1Cost))
            {
                thisMiningshaft.ExpandMiningShaft(2);
                thisMiningshaft.expansionLevel++;
                thisButton.GetComponentInChildren <PriceTagWidget>(true).SetNewPrice(mineExpansion2Cost);
            }
        }
        else if (thisMiningshaft.expansionLevel == 1)
        {
            if (CheckAffordability(mineExpansion2Cost))
            {
                thisMiningshaft.ExpandMiningShaft(2);
                thisMiningshaft.expansionLevel++;
                thisButton.GetComponentInChildren <PriceTagWidget>(true).SetNewPrice(mineExpansion3Cost);
            }
        }
        else if (thisMiningshaft.expansionLevel == 2)
        {
            if (CheckAffordability(mineExpansion3Cost))
            {
                thisMiningshaft.ExpandMiningShaft(2);
                thisMiningshaft.expansionLevel++;
                thisButton.GetComponentInChildren <PriceTagWidget>(true).SetNewPrice(0);
                thisButton.interactable = false;
            }
        }
    }
Beispiel #2
0
 public void FireMiner()
 {
     DestroyImmediate(GetComponentInParent <MinerSlot>().gameObject);
     miningShaft.ExpandMiningShaft(1);
     miningShaft.SetNumberOfMinersInMiningShaft();
     //DestroyImmediate(this.gameObject);
     miningShaft.UpdateExpectedExpenditure(resourceManager.CalculateAllMinersSalary());
 }