Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Text changed

Discussion in 'UI Toolkit' started by JackPS9, Feb 14, 2020.

  1. JackPS9

    JackPS9

    Joined:
    Nov 14, 2013
    Posts:
    37
    What's a decent way to tell if the text in a textfield has been change?
    Trying to edit scriptable objects through a custom editor, and I want to start playing around with UIElements so figured it'd be good to try to update my editors.
     
  2. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    Code (csharp):
    1. visualElement.RegisterValueChangedCallback(v => Debug.Log(v.newValue));
     
    Ghosthowl likes this.
  3. JackPS9

    JackPS9

    Joined:
    Nov 14, 2013
    Posts:
    37
    oh thank you, I should be able to write the majority of my editors with that part alone.