public void Disable(Receources rec) { if (rec == typeOfReceource) { this.enabled = false; } }
public void ChangeRec(Receources resouce) { var slider = GetComponentInChildren <Slider>(); switch (resouce) { case Receources.SEEDS: rec = Receources.SEEDS; slider.value = 0; changeValueTo(Receources.SEEDS); break; case Receources.WATER: rec = Receources.WATER; slider.value = 0; changeValueTo(Receources.WATER); break; case Receources.MONEY: rec = Receources.MONEY; slider.value = 0; changeValueTo(Receources.MONEY); break; } }
public void Enable(Receources rec) { if (rec == typeOfReceource) { this.enabled = true; } }
public void ChangeValueWhileProducing(Receources _rec, float value) { switch (_rec) { case Receources.SEEDS: seedsNumber = value; if (rec == Receources.SEEDS) { changeValueTo(Receources.SEEDS); } break; case Receources.WATER: waterNumber = value; if (rec == Receources.WATER) { changeValueTo(Receources.WATER); } break; case Receources.MONEY: moneyNumber = value; if (rec == Receources.MONEY) { changeValueTo(Receources.MONEY); } break; } }
public void SendShip(Planet from, Planet to, Receources resource, int amount) { GameObject spaceShipRef = Instantiate(SpaceShipPrefab, from.transform.position, Quaternion.identity); spaceShipRef.GetComponent <SpaceShipController>()?.SetTargetPlanet(to); //spaceShipRef.GetComponent<PlanetReceources>()?.AddReceource(resource, amount); spaceShipRef.GetComponent <UnitResources>().AddResource(resource, amount); }
public Sprite GetImageOfType(Receources receources) { foreach (IndicatorPairs pair in ResourceImagePairs) { if (pair.resourceType == receources) { return(pair.image); } } return(null); }
public void ChangeTypeOfReceource(Receources rec) { switch (rec) { case Receources.SEEDS: typeOfReceurce = Receources.SEEDS; break; case Receources.WATER: typeOfReceurce = Receources.WATER; break; case Receources.MONEY: typeOfReceurce = Receources.MONEY; break; } }
public void ChangeTypeOfReceource(int i) { switch (i) { case 1: typeOfReceurce = Receources.SEEDS; break; case 2: typeOfReceurce = Receources.WATER; break; case 3: typeOfReceurce = Receources.MONEY; break; } }
void changeValueTo(Receources _rec) { var slider = GetComponentInChildren <Slider>(); switch (_rec) { case Receources.SEEDS: slider.maxValue = seedsNumber; rec = _rec; break; case Receources.WATER: slider.maxValue = waterNumber; rec = _rec; break; case Receources.MONEY: slider.maxValue = moneyNumber; rec = _rec; break; } }
public void UpdateUpgradeText(Receources resource, string description, int price) { switch (resource) { case Receources.SEEDS: farmUpgradeDescription.text = description; var buttonPriceTextFarm = farmUpgradeButton.GetComponentInChildren <TextMeshProUGUI>(); buttonPriceTextFarm.text = price.ToString(); break; case Receources.WATER: waterUpgradeDescription.text = description; var buttonPriceTextWater = waterUpgradeButton.GetComponentInChildren <TextMeshProUGUI>(); buttonPriceTextWater.text = price.ToString(); break; case Receources.MONEY: mineUpgradeDescription.text = description; var buttonPriceTextMine = mineUpgradeButton.GetComponentInChildren <TextMeshProUGUI>(); buttonPriceTextMine.text = price.ToString(); break; } }
public void ChangeAmount(Receources rec, int amount) { switch (rec) { case Receources.SEEDS: seedsNumber = amount; seeds.text = seedsNumber.ToString(); Debug.Log("seedstext " + seeds.text); break; case Receources.WATER: waterNumber = amount; water.text = waterNumber.ToString(); break; case Receources.MONEY: moneyNumber = amount; money.text = moneyNumber.ToString(); break; } }
public void UpdateResourceButtons(Receources rec, int amount) { UIResouceButtons.GetComponent <ResourcesButtonsUpdater>().ChangeAmount(rec, amount); UITransportZone.GetComponentInChildren <ChangeMaxValue>().ChangeValueWhileProducing(rec, amount); }
public void UpdateUpgrades(Receources resource, string description, int price) { UIInvestmentZone.GetComponent <InvestmentZoneUpdater>().UpdateUpgradeText(resource, description, price); }
public void AddResource(Receources resourceType, int amount) { resources[resourceType] += amount; }