コード例 #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
ファイル: Toaster.cs プロジェクト: ofmendez/PruebaLegis
 public void PopupToast()
 {
     ToastControl.MakeToast(text, duration, panelColor, textColor, fontSize);
 }
コード例 #4
0
ファイル: Toaster.cs プロジェクト: ofmendez/PruebaLegis
 void Start()
 {
     ToastControl.InitToastSystem(gameObject.GetComponentInParent <Canvas>());
 }