Git Product home page Git Product logo

Comments (3)

TreHack avatar TreHack commented on May 21, 2024

Textmesh pro is a third plug-in, You can refer to the GameObjectText function in UnityNode.cs to get the attr of TEXT INPUT BOX by yourself.

from poco-sdk.

4karion avatar 4karion commented on May 21, 2024

Hi! I need to be able to read TextMeshPro text too, but i'm having some problems when trying to do this, help would be appreciated.

For my needs, i've modified the GameObjectText function to return TMP_Text if available and the normal Text if not. Here is my code:

private string GameObjectText()
{
TMP_Text tmpText = gameObject.GetComponent<TMP_Text>();
if (tmpText) return tmpText.text;
Text text = gameObject.GetComponent();
if (text) return text.text;
return null;
}

With this implementation, when i'm connected to an Android phone, i'm always getting the default value that is setted on the Unity Inspector, but not the actual updated value that i'm seeing ingame. It doesn't matter if it's through Airtest UI-hierarchy view or by poco("MoneyButtonText").get_text() on Python.
The normal Text (not TMP text) is updating without problems and sends always the last value.

For some reason, the solution works flawless over UnityEditor.

Is there any way to "update" the value, the dump, or whatever is needed?

Thanks in advance

from poco-sdk.

4karion avatar 4karion commented on May 21, 2024

I've solved it by changing this line
if (tmpText) return tmpText.text;
to
if (tmpText) return tmpText.GetParsedText();

from poco-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.