void Update() { if (m_state == TriggerTextState.VISIBLE) { m_showTime += Time.deltaTime; if (m_showTime >= m_showDuration) { m_showTime = 0; m_state = TriggerTextState.FADE_OUT; } } else if (m_state == TriggerTextState.FADE_IN) { fadeIn(); if (alpha >= 0.99f) { color = alpha_opaque100; m_state = TriggerTextState.VISIBLE; } } else if (m_state == TriggerTextState.FADE_OUT) { fadeOut(); if (alpha <= 0.01f) { color = alpha_opaque0; m_state = TriggerTextState.INVISIBLE; } } }
void Start() { m_text = gameObject.GetComponent <Text>(); m_state = TriggerTextState.INVISIBLE; m_showTime = 0; color = alpha_opaque0; }
public void showText(string t) { text = t; m_state = TriggerTextState.FADE_IN; }
void Start() { m_text = gameObject.GetComponent<Text>(); m_state = TriggerTextState.INVISIBLE; m_showTime = 0; color = alpha_opaque0; }