コード例 #1
0
    public static void SpawnText(ScriptableInteractionText text, Vector3 position)
    {
        if (text == null)
        {
            return;
        }
        if (singleton == null)
        {
            return;
        }

        singleton.MoveText(text, position);
    }
コード例 #2
0
    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);
    }