123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class Toast : Regist
- {
- #region 变量
- public static bool On;
- public static float Timer;
- public static Text Text;
- public static Transform Transform;
- #endregion
- public void FixedUpdate()
- {
- if (On)
- {
- Timer -= Time.fixedDeltaTime;
- if (Timer <= 0)
- {
- On = false;
- transform.TweenBacCG();
- transform.TweenBacVec();
- }
- }
- }
- public override void RegistImmed()
- {
- if (RegistFlag)
- {
- return;
- }
- else
- {
- RegistFlag = true;
- }
- Text = GetComponentInChildren<Text>();
- Transform = transform;
- transform.CreateTweenCG(0, 1, 0.25f, false, true, Curve.EaseOutQuad);
- transform.CreateTweenVec2D(ManaReso.Get("O_Pos").position, 0.25f, false, false, true, Curve.EaseOutQuad);
- }
- public static void Show(float time, string str)
- {
- ManaAudio.PlayClip(Clip.ErrorClip);
- On = true;
- Text.text = str;
- Timer = time;
- Transform.TweenForCG();
- Transform.TweenForVec();
- }
- }
|