void Update() { if (regionOrigin != null) { slider.value = regionOrigin.GetComponent <RegionBase>().regionQuality / regionOrigin.GetComponent <RegionBase>().maxRegionQuality; } }
public virtual void UpdateEvent() { if (isResolving == true) { eventDataCopy.turnsToResolve--; turnsToResolve.text = eventDataCopy.turnsToResolve.ToString(); if (eventDataCopy.turnsToResolve <= 0) { isResolved = true; } } if (isResolved == true) { regionOrigin.GetComponent <RegionBase>().regionQuality += eventDataCopy.qualityDecay * regionOrigin.GetComponent <RegionBase>().maxRegionQuality; turnsLeft = 0; Destroy(this.gameObject); eventManager.eventTracker.Remove(this.gameObject); } if (isResolving == false) { turnsToResolve.gameObject.SetActive(false); turnsLeft -= 1; if (turnsLeft > 0) { GetComponent <Image>().sprite = timerSprites[turnsLeft - 1]; } if (turnsLeft <= 0) { Destroy(this.gameObject); eventManager.eventTracker.Remove(this.gameObject); } } }