Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Help with Inspector string boxes - Where do I put TextArea when working with List<string> instead of

Discussion in 'Getting Started' started by mangapinches, Sep 22, 2019.

  1. mangapinches

    mangapinches

    Joined:
    Apr 2, 2019
    Posts:
    12
    TLDR = Where do I put TextArea when working with List<string> instead of just public string?

    So I am creating a dialogue system that uses List<string>. I'm also new to coding...

    Typing the dialogue in the inspector is really annoying because I can only see one line...even if the dialogue box contains more text.

    I have heard of TextAreaAttribute which works by declaring before the variable like this:
    [TextArea]
    public string MyTextArea;


    I tried putting [TextArea(int, int)] before declaring the List<string> but it didn't work. Where do I put TextArea when working with List<string> instead of just public string?



    EDIT: I'm dumb!

    I passed in a string array using a different script. Putting [TextArea] before declaring the string array did the trick! Solution:

    [TextArea(int, int)]
    public string[] youSolvedItBuddy;
     
    Last edited: Sep 22, 2019
    Olipool and JoeStrout like this.
unityunity