コード例 #1
0
 /* 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);
 }
コード例 #2
0
    /* 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);
    }
コード例 #3
0
ファイル: EnemyAI.cs プロジェクト: MattFiler/FoundryAgario
 public void SetEnemyType(RainyDayType type)
 {
     thisType          = type;
     ThisSprite.sprite = RainyDaySprites[(int)type];
 }