Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

There are the setting of stm and  the code I used for my tests, maybe this information will be useful to you.

using System.Collections;

using UnityEngine;

public class Test : MonoBehaviour

{

    public SuperTextMesh superTextMesh;

    private void Awake()

    {

        superTextMesh.gameObject.SetActive(false);//the superTextMesh is hide when game is start.

        superTextMesh.readDelay = 0.01f;//read delay >0

        superTextMesh.autoRead = false; //auto read set false, I will call auto read later

    }

    //add it to buttons

    public void AddToButton1()

    {

        StartCoroutine(TestCode1());

    } public void AddToButton2()

    {

        StartCoroutine(TestCode2());

    } public void AddToButton3()

    {

        StartCoroutine(TestCode3());

    }

    //set stm gameobject active and call read immediately.

    public IEnumerator TestCode1()

    {

        superTextMesh.gameObject.SetActive(true);

        superTextMesh.Read();

        Debug.Log(superTextMesh.reading);//true

        yield return null;

        Debug.Log(superTextMesh.reading);//false

        yield return null;

        Debug.Log(superTextMesh.reading);//false

        yield return null;

        Debug.Log(superTextMesh.reading);//false

    }

    //set stm gameobject active and call read after one frame.

    public IEnumerator TestCode2()

    {

        superTextMesh.gameObject.SetActive(true);

        yield return null;

        superTextMesh.Read();

        Debug.Log(superTextMesh.reading);//false

        yield return null;

        Debug.Log(superTextMesh.reading);//false

        yield return null;

        Debug.Log(superTextMesh.reading);//false

    }

    //set stm gameobject active and call read after two frame.

    public IEnumerator TestCode3()

    {

        superTextMesh.gameObject.SetActive(true); 

        yield return null;

        yield return null;

        superTextMesh.Read();

        Debug.Log(superTextMesh.reading);//false

        yield return null;

        Debug.Log(superTextMesh.reading);//false

    }

}

(1 edit)

Ok, I think I've fixed it! Please send me an email through my website so I can send you an updated version of SuperTextMesh.cs!

I just emailed you and thank you so much for your help.