예제 #1
0
 void Update()
 {
     if (state == 1)
     {
         if (thisRect.position.y < onPos.y)
         {
             tempVec2          = thisRect.position;
             tempVec2.y        = Mathf.Lerp(tempVec2.y, onPos.y * 1.01f, Time.deltaTime * animSpeed);
             thisRect.position = tempVec2;
             canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 1.01f, Time.deltaTime * animSpeed);
         }
         else
         {
             thisRect.position = onPos;
             // Avoid update from repeating this loop while waiting
             state = 0;
             StartCoroutine(WaitTime());
         }
     }
     else if (state == 2)
     {
         if (thisRect.position.y > offPos.y)
         {
             tempVec2          = thisRect.position;
             tempVec2.y        = Mathf.Lerp(tempVec2.y, offPos.y * 0.99f, Time.deltaTime * animSpeed);
             thisRect.position = tempVec2;
             canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, -0.01f, Time.deltaTime * animSpeed);
         }
         else
         {
             ToastControl.RemoveLastToast();
             Destroy(gameObject);
         }
     }
 }
예제 #2
0
 public void PopupToast()
 {
     ToastControl.toastText       = text;
     ToastControl.toastDuration   = duration;
     ToastControl.toastPanelColor = panelColor;
     ToastControl.toastTextColor  = textColor;
     ToastControl.toastFontSize   = fontSize;
     if (ToastControl.toastPrefab != null)
     {
         GameObject toast = Instantiate(ToastControl.toastPrefab) as GameObject;
         ToastControl.AddToast(toast);
     }
 }
예제 #3
0
 public void PopupToast()
 {
     ToastControl.MakeToast(text, duration, panelColor, textColor, fontSize);
 }
예제 #4
0
 void Start()
 {
     ToastControl.InitToastSystem(gameObject.GetComponentInParent <Canvas>());
 }