Search Unity

Question Turn UnityEvent string param into TextArea in inspector.

Discussion in 'UGUI & TextMesh Pro' started by BoogerJar, Feb 7, 2024.

  1. BoogerJar


    Jan 7, 2021
    Hi guys, i am currently working on a Tutorial script, however i have a bit of a question that came during my development process.

    I have gotten a script called 'TextWriter' this script as you can probably guess writes text towards a text field that is currently present in the script. Indicated by the 'TextArea' Text To Print variable. Please refer to ScreenShot1 as reference to what i am talking about.

    The tutorial script works based upon steps, when it moves a step, a onStepExited (UnityEvent) event is invoked, and a onStepEntered (UnityEvent) is invoked, as you can see in ScreenShot2. What i would like, is that i can edit the 'TextToPrint' variable as a TextArea as well in the event, not a singular string. However, how do i do this? Is this even possible to do with custom editor scripting? (I'm new with custom Editor Scripting).

    The reason i want this to work like that, is that for the tutorial i would like all changes to it to be in one cohesive place, not that i would have to go somewhere else for the text to just plop it in there.

    Also i have no clue if this is even the correct place to post this, i am new to the forums so do please direct me in the right direction if this is the wrong place.

    Thanks for your response in advance,

    Attached Files: