public void SetAnnouncement(Transform bind, Color c, string message) { worldPosition = bind.position; text = GetComponent <Text> (); Vector2 offset = new Vector2(UnityEngine.Random.Range(-1.5f, 1.5f), UnityEngine.Random.Range(-1.5f, 1.5f)); worldPosition += (Vector3)offset; text.fontSize = text.fontSize + UnityEngine.Random.Range(-5, 5); CachedRectTransform.AlignToWorldPosition(worldPosition, TrashUIManager.Instance.uiCanvas.planeDistance); Vector3 rotation = bind.root.eulerAngles; rotation.z += UnityEngine.Random.Range(-20f, 20f); CachedTransform.rotation = Quaternion.Euler(rotation); text.color = c; startAlpha = text.color.a; text.text = message; }
void LateUpdate() { CachedRectTransform.AlignToWorldPosition(worldPosition, TrashUIManager.Instance.uiCanvas.planeDistance); }
public void AlignToWorldPosition(Vector3 worldPosition) { CachedRectTransform.AlignToWorldPosition(worldPosition); }