public void Init(string s, int size, float t, Bowhead.Actors.Pawn target) { totalTime = time = t; text = GetComponent <UnityEngine.UI.Text>(); text.fontSize = size; text.color = Color.red; text.text = s; startPos = target.headPosition(); transform.position = Camera.main.WorldToScreenPoint(startPos); Destroy(gameObject, time); }
public void Init(float d, float t, Color c, Bowhead.Actors.Pawn target) { totalTime = time = t; text = GetComponent <UnityEngine.UI.Text>(); text.fontSize = (int)Mathf.Clamp(Mathf.Sqrt(d / 5) * 20, 20, 40); text.color = Color.red; text.text = Mathf.CeilToInt(d).ToString(); startPos = target.headPosition(); transform.position = Camera.main.WorldToScreenPoint(startPos); startColor = c; Destroy(gameObject, time); }