public void Play(float duration, float startScale, float endScale, float startAlpha, float endAlpha, OnTimeoutDelegate timeout = null) { m_startScale = startScale; m_endScale = endScale; m_startAlpha = startAlpha; m_endAlpha = endAlpha; Vector3 scale = Vector3.zero; scale.x = scale.y = m_startScale; scale.z = 1.0f; transform.localScale = scale; Color col = m_renderer.color; col.a = m_startAlpha; m_renderer.color = col; m_total = duration; m_start = Time.time; if (timeout != null) { m_onTimeout -= timeout; m_onTimeout += timeout; } }
public void Play(string text, float duration, float startScale, float endScale, Color color, float startAlpha, float endAlpha, Vector3 localPos, Vector3 direction, float speed, OnTimeoutDelegate lifetimeDelegate = null) { m_start = Time.time; m_duration = duration; transform.localPosition = localPos; m_direction = direction; m_direction.Normalize(); m_speed = speed; m_defaultScale = transform.localScale; m_startScale = startScale; m_endScale = endScale; Vector3 newScale = m_defaultScale; m_defaultScale.x *= m_startScale; m_defaultScale.y *= m_startScale; transform.localScale = newScale; m_startAlpha = startAlpha; m_endAlpha = endAlpha; m_textComponent.color = color; Color textColor = m_textComponent.color; textColor.a = m_startScale; m_textComponent.color = textColor; m_textComponent.text = text; if (lifetimeDelegate != null) { m_onTimeout -= lifetimeDelegate; m_onTimeout += lifetimeDelegate; } }
public void Play(float duration, OnTimeoutDelegate timeout = null) { m_start = Time.time; m_total = duration; if (timeout != null) { m_onTimeout -= timeout; m_onTimeout += timeout; } }