Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class FloatingText : MonoBehaviour {
- public Animator animator;
- private Text damageText;
- void OnEnable()
- {
- AnimatorClipInfo[] clipInfo = animator.GetCurrentAnimatorClipInfo(0);
- Debug.Log(clipInfo.Length);
- Destroy(gameObject, clipInfo[0].clip.length);
- damageText = animator.GetComponent<Text>();
- }
- public void SetText(string text)
- {
- damageText.text = text;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement