public static void SpawnText(ScriptableInteractionText text, Vector3 position) { if (text == null) { return; } if (singleton == null) { return; } singleton.MoveText(text, position); }
public void MoveText(ScriptableInteractionText text, Vector3 position) { if (textOnObject) { Vector2 pos = _cam.WorldToScreenPoint(position); transform.position = pos; } if (textOnScreen) { StopCoroutine(textTimer); } graphicsObject.gameObject.SetActive(true); textObject.text = text.interactionText; ForceUpdateLayout(); textOnScreen = true; textTimer = TextTimer(text.secondsOnScreen); StartCoroutine(textTimer); }