/* Set the current rainy day issue */ public void SetRainyDay(RainyDayType issue) { CurrentRainyDay = issue; RainyDayTypeSprite.gameObject.SetActive(true); RainyDayTypeSprite.sprite = RainyDaySprites[(int)issue]; TimeSinceRainyDay = 0.0f; RainyDayErrorCover.SetActive(true); RainyDayErrorCover.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); }
/* Update the rainy day progress bar, and disable rainy day status if zero */ void FixedUpdate() { TimeSinceRainyDay += Time.deltaTime; if (TimeSinceRainyDay >= TimeForRainyDay) { CurrentRainyDay = RainyDayType.MAX_TYPES; RainyDayTypeSprite.gameObject.SetActive(false); RainyDayErrorCover.SetActive(false); return; } float RainyDayProgress = TimeSinceRainyDay / TimeForRainyDay; if (RainyDayProgress > 1) { RainyDayProgress = 1; } if (RainyDayProgress < 0) { RainyDayProgress = 0; } RainyDayProgress = (RainyDayProgress - 1) * -1; RainyDayErrorCover.transform.localScale = new Vector3(1.0f, RainyDayProgress, 1.0f); }
public void SetEnemyType(RainyDayType type) { thisType = type; ThisSprite.sprite = RainyDaySprites[(int)type]; }