using UnityEngine; using UnityEngine.UI; using System; using System.Collections; public class HudText : Regist { #region 变量 public Text Text { get { if (Text_ == null) { Text_ = GetComponent(); } return Text_; } set { Text_ = value; } } public Text Text_; public float Speed; #endregion public override void RegistImmed() { if (RegistFlag) { return; } else { RegistFlag = true; } enabled = true; } private void FixedUpdate() { transform.position += new Vector3(0, Speed*Time.fixedDeltaTime, 0); if (Text.color.a <= 0.05f) { ManaReso.Save(gameObject); } } public void Show(string str, Color color, int size, float speed, float time) { Text.text = str; Text.color = color; Text.fontSize = size; Speed = speed; Tween tween = Text.CreateTweenGra(0, time, false, false, Curve.EaseOutQuad); tween.StartForward(); } }