Esempio n. 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         string t = ui.Read(TipIndex);
         if (t != "")
         {
             TipShower.GetComponentInChildren <Text>().text = t;
             TipShower.SetActive(true);
             StartCoroutine("Fade");
         }
     }
 }
Esempio n. 2
0
 IEnumerator Fade()
 {
     if (IsPlaying)
     {
         IsPlaying = false;
         yield return(null);
     }
     for (int i = 0; i < count; i++)
     {
         if (ui.CurrentIndex != TipIndex)
         {
             break;
         }
         TipShower.GetComponentInChildren <Text>().color  = new Color(0, 0, 0, (count - i) / (float)count);
         TipShower.GetComponentInChildren <Image>().color = new Color(1, 1, 1, (count - i) / (float)count);
         yield return(new WaitForSeconds(0.2f));
     }
     if (ui.CurrentIndex == TipIndex)
     {
         TipShower.SetActive(false);
     }
     yield return(null);
 }