using UnityEngine; using UnityEngine.UI; using System; using System.Collections; public class HudText : ObjRoot { #region 变量 public Text Text { get { if (_Text == null) { _Text = GetComponent(); } return _Text; } set { _Text = value; } } private Text _Text; #endregion private void FixedUpdate() { transform.position += new Vector3(0, 7.5f*Time.fixedDeltaTime, 0); Text.SetAlpha(Mathf.Lerp(Text.color.a, 0, Time.fixedDeltaTime*2)); if (Text.color.a <= 0.05f) { ManaReso.SaveUI(gameObject); } } public void Show(string str, Color color, int size) { Text.text = str; Text.color = color; Text.fontSize = size; } }