BattleInfoItem.cs 482 B

12345678910111213141516171819202122232425262728
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. public class BattleInfoItem : MonoBehaviour {
  5. public Text text;
  6. public Animator animator;
  7. private float startTime;
  8. private float duration = 5f;
  9. // Use this for initialization
  10. void Start ()
  11. {
  12. startTime = GameTime.time;
  13. }
  14. // Update is called once per frame
  15. void FixedUpdate ()
  16. {
  17. if(GameTime.time - startTime > duration)
  18. {
  19. animator.Play("BattleInfoItemHide");
  20. Destroy(this);
  21. }
  22. }
  23. }