Exemplo n.º 1
0
 private void OnEnable()
 {
     this.m_isFadingIn        = true;
     this.m_isFadingOut       = false;
     this.m_fadeInTimeElapsed = 0f;
     foreach (CanvasGroup canvasGroup in this.m_fadeCanvasGroups)
     {
         canvasGroup.alpha = 0f;
     }
     if (StaticDB.StringsAvailable())
     {
         this.m_cancelText.text = StaticDB.GetString("CANCEL", null);
     }
 }
Exemplo n.º 2
0
 private void OnEnable()
 {
     this.m_isFadingIn        = true;
     this.m_isFadingOut       = false;
     this.m_fadeInTimeElapsed = 0f;
     CanvasGroup[] fadeCanvasGroups = this.m_fadeCanvasGroups;
     for (int i = 0; i < fadeCanvasGroups.Length; i++)
     {
         CanvasGroup canvasGroup = fadeCanvasGroups[i];
         canvasGroup.set_alpha(0f);
     }
     if (StaticDB.StringsAvailable())
     {
         this.m_cancelText.set_text(StaticDB.GetString("CANCEL", null));
     }
 }
Exemplo n.º 3
0
 private void Update()
 {
     if (StaticDB.StringsAvailable())
     {
         if (!this.m_cancelButton.get_activeSelf())
         {
             this.m_cancelButton.SetActive(true);
             this.m_cancelText.set_text(StaticDB.GetString("CANCEL", null));
         }
     }
     else if (this.m_cancelButton.get_activeSelf())
     {
         this.m_cancelButton.SetActive(false);
     }
     if (this.m_isFadingIn && this.m_fadeInTimeElapsed < this.m_fadeInDuration)
     {
         this.m_fadeInTimeElapsed += Time.get_deltaTime();
         float         alpha            = Mathf.Clamp(this.m_fadeInTimeElapsed / this.m_fadeInDuration, 0f, 1f);
         CanvasGroup[] fadeCanvasGroups = this.m_fadeCanvasGroups;
         for (int i = 0; i < fadeCanvasGroups.Length; i++)
         {
             CanvasGroup canvasGroup = fadeCanvasGroups[i];
             canvasGroup.set_alpha(alpha);
         }
     }
     if (this.m_isFadingOut && this.m_fadeOutTimeElapsed < this.m_fadeOutDuration)
     {
         this.m_fadeOutTimeElapsed += Time.get_deltaTime();
         float         alpha2            = 1f - Mathf.Clamp(this.m_fadeOutTimeElapsed / this.m_fadeOutDuration, 0f, 1f);
         CanvasGroup[] fadeCanvasGroups2 = this.m_fadeCanvasGroups;
         for (int j = 0; j < fadeCanvasGroups2.Length; j++)
         {
             CanvasGroup canvasGroup2 = fadeCanvasGroups2[j];
             canvasGroup2.set_alpha(alpha2);
         }
         if (this.m_fadeOutTimeElapsed > this.m_fadeOutDuration)
         {
             this.m_isFadingOut = false;
             base.get_gameObject().SetActive(false);
         }
     }
 }
Exemplo n.º 4
0
 private void Update()
 {
     if (StaticDB.StringsAvailable())
     {
         if (!this.m_cancelButton.activeSelf)
         {
             this.m_cancelButton.SetActive(true);
             this.m_cancelText.text = StaticDB.GetString("CANCEL", null);
         }
     }
     else if (this.m_cancelButton.activeSelf)
     {
         this.m_cancelButton.SetActive(false);
     }
     if (this.m_isFadingIn && this.m_fadeInTimeElapsed < this.m_fadeInDuration)
     {
         this.m_fadeInTimeElapsed += Time.deltaTime;
         float alpha = Mathf.Clamp(this.m_fadeInTimeElapsed / this.m_fadeInDuration, 0f, 1f);
         foreach (CanvasGroup canvasGroup in this.m_fadeCanvasGroups)
         {
             canvasGroup.alpha = alpha;
         }
     }
     if (this.m_isFadingOut && this.m_fadeOutTimeElapsed < this.m_fadeOutDuration)
     {
         this.m_fadeOutTimeElapsed += Time.deltaTime;
         float alpha2 = 1f - Mathf.Clamp(this.m_fadeOutTimeElapsed / this.m_fadeOutDuration, 0f, 1f);
         foreach (CanvasGroup canvasGroup2 in this.m_fadeCanvasGroups)
         {
             canvasGroup2.alpha = alpha2;
         }
         if (this.m_fadeOutTimeElapsed > this.m_fadeOutDuration)
         {
             this.m_isFadingOut = false;
             base.gameObject.SetActive(false);
         }
     }
 }