예제 #1
0
    private IEnumerator HideAnnouncerText(float secondsToHide, Action actionAfterAnnouncer)
    {
        yield return(new WaitForSeconds(secondsToHide));

        AnnouncerTextGameObject.SetActive(false);
        actionAfterAnnouncer?.Invoke();
    }
예제 #2
0
 private void Start()
 {
     BatteryTextGameObjects = new GameObject[0];
     LivesTextGameObjects   = new GameObject[0];
     LightningCoroutines    = new List <Coroutine>();
     FloorDarkColor         = FloorTilemap.color;
     AnnouncerTextGameObject.SetActive(false);
     LightningTicker = UnityEngine.Random.Range(LightningTickerMin, LightningTickerMax);
 }
예제 #3
0
 public void ShowAnnouncerText(string text, Color color, bool permanent, float secondsToHide = 0, Action actionAfterAnnouncer = null)
 {
     AnnouncerTextGameObject.GetComponent <TextMeshProUGUI>().text  = text;
     AnnouncerTextGameObject.GetComponent <TextMeshProUGUI>().color = color;
     AnnouncerTextGameObject.SetActive(true);
     if (!permanent)
     {
         StartCoroutine(HideAnnouncerText(secondsToHide, actionAfterAnnouncer));
     }
 }