public void Show(string text, HudTextColor color = HudTextColor.White, float delay = 1.0f) { Text.text = text; switch (color) { case HudTextColor.White: Text.color = WhiteColor; Text.effectColor = WhiteColorOutline; break; case HudTextColor.Green: Text.color = GreenColor; Text.effectColor = GreenColorOutline; break; case HudTextColor.Red: Text.color = RedColor; Text.effectColor = RedColorOutline; break; case HudTextColor.Yellow: Text.color = YellowColor; Text.effectColor = YellowColorOutline; break; } gameObject.SetActive(true); gameObject.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f); StopAllCoroutines(); StartCoroutine(ShowHudText(delay)); }
public void ShowHudText(string text, HudTextColor color = HudTextColor.White, float delay = 1.0f) { HudText.Show(text, color, delay); }