33 lines
570 B
C#
33 lines
570 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Oculus.Platform.Samples.VrHoops
|
|
{
|
|
public class FlyText : MonoBehaviour
|
|
{
|
|
private const float LIFESPAN = 3f;
|
|
|
|
private readonly Vector3 m_movePerFrame = 0.5f * Vector3.up;
|
|
|
|
private float m_eol;
|
|
|
|
private void Start()
|
|
{
|
|
m_eol = Time.time + 3f;
|
|
GetComponent<Text>().CrossFadeColor(Color.black, 5.1000004f, false, true);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Time.time < m_eol)
|
|
{
|
|
base.transform.localPosition += m_movePerFrame;
|
|
}
|
|
else
|
|
{
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
}
|
|
}
|
|
}
|