Пример #1
0
 /// <summary>
 /// Makes max value of sliders match the amount in inventory
 /// </summary>
 public void UpdateSliderValues()
 {
     oreSlider.maxValue      = controller.FindResourceContainer(RTSCargoType.ironOre).amount;
     ironSlider.maxValue     = controller.FindResourceContainer(RTSCargoType.iron).amount;
     oilSlider.maxValue      = controller.FindResourceContainer(RTSCargoType.oil).amount;
     fuelSlider.maxValue     = controller.FindResourceContainer(RTSCargoType.fuel).amount;
     plasticSlider.maxValue  = controller.FindResourceContainer(RTSCargoType.plastic).amount;
     peopleSlider.maxValue   = controller.FindResourceContainer(RTSCargoType.people).amount;
     clerksSlider.maxValue   = controller.FindResourceContainer(RTSCargoType.clerks).amount;
     workersSlider.maxValue  = controller.FindResourceContainer(RTSCargoType.workers).amount;
     soldiersSlider.maxValue = controller.FindResourceContainer(RTSCargoType.soldiers).amount;
 }
Пример #2
0
    /// <summary>
    /// Checks if player delivered enough resources and ends the game if he did
    /// </summary>
    public void CheckTarget()
    {
        foreach (var resource in target)
        {
            if (controller.FindResourceContainer(resource.cargo.CargoType).amount < resource.amount)
            {
                return;
            }
        }

        GameObject.Find("GameController").GetComponent <RTSGameState>().Victory();
    }