コード例 #1
0
 void Update()
 {
     if (regionOrigin != null)
     {
         slider.value = regionOrigin.GetComponent <RegionBase>().regionQuality / regionOrigin.GetComponent <RegionBase>().maxRegionQuality;
     }
 }
コード例 #2
0
    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);
            }
        }
    }