//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Thursday, September 14, 2017
|
//--------------------------------------------------------
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
|
public class TextMove : MonoBehaviour
|
{
|
[SerializeField] ScreenMoveTo m_MoveTo;
|
[SerializeField] UIAlphaTween m_AlphaTween;
|
|
[SerializeField] Text m_Text;
|
public float startX;
|
public float startY;
|
|
|
public void Begin(string content)
|
{
|
this.transform.SetActive(true);
|
SetEnable(true);
|
m_Text.text = content;
|
|
this.transform.localPosition = new Vector3(startX, startY, 0);
|
m_MoveTo.Begin(OnFloatEnd);
|
m_Text.color = m_Text.color.SetA(1f);
|
m_AlphaTween.SetStartState();
|
m_AlphaTween.Play();
|
}
|
|
public void SetEnable(bool _enable)
|
{
|
m_MoveTo.enabled = _enable;
|
m_AlphaTween.enabled = _enable;
|
}
|
|
private void OnFloatEnd()
|
{
|
SetEnable(false);
|
this.transform.SetActive(false);
|
}
|
|
}
|
|
}
|