private void InvestInCurrent(int spent)
 {
     Debug.Log(CurrentInvestment);
     if (CurrentInvestment == 0)
     {
         if (data.DepleteFund(spent) == true)
         {
             data.UpgradeWaterTowers(spent);
         }
     }
     else if (CurrentInvestment == 1)
     {
         if (data.DepleteFund(spent) == true)
         {
             data.WaterSources[0].Investment(spent);
             data.CalculateWaterDistributionRate();
         }
     }
     else if (CurrentInvestment == 2)
     {
         if (data.DepleteFund(spent) == true)
         {
             data.WaterSources[1].Investment(spent);
             data.CalculateWaterDistributionRate();
         }
     }
     else if (CurrentInvestment == 3)
     {
         if (data.DepleteFund(spent) == true)
         {
             data.WaterSources[2].IncSource(spent);
             data.CalculateWaterDistributionRate();
         }
     }
 }
Exemplo n.º 2
0
    private void WTInvestmentListener(int spent)
    {
        if (data.DepleteFund(spent) == true)
        {
            data.UpgradeWaterTowers();

            /*int i= 0;
             * while (data.AmmountPulledFromSources[i] != 0)
             * {
             *  print(data.AmmountPulledFromSources[i]);
             *  i++;
             * }*/
        }
    }