12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using UnityEngine;
- using UnityEngine.UI;
- using System;
- using System.Collections;
- public class HudText : Regist
- {
- #region 变量
- public Text Text
- {
- get
- {
- if (Text_ == null)
- {
- Text_ = GetComponent<Text>();
- }
- return Text_;
- }
- set { Text_ = value; }
- }
- public Text Text_;
- public float Speed;
- #endregion
- public override void RegistImmed()
- {
- 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;
- TweenRoot tween = Text.CreateTweenGra(0, time, false, false, Curve.EaseOutQuad);
- tween.StartForward();
- }
- }
|