Search Unity

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:
    11
    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
    JoeStrout likes this.