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() { Text = GetComponentInChildren(); 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(); } }