Search Unity

Write a line break in the editor?

Discussion in 'Immediate Mode GUI (IMGUI)' started by Eric, Aug 18, 2009.

  1. Eric

    Eric

    Joined:
    Nov 17, 2008
    Posts:
    20
    Hi,

    is it possible to write a line break as the value of a public string variable?

    At the moment I work with the following line at Awake (C#).

    Code (csharp):
    1. myText = myText.Replace("#", "\n");
    It would be nice, if I could directly write line breaks in the editor and don't have to replace special chars at runtime.
     
  2. Eric

    Eric

    Joined:
    Nov 17, 2008
    Posts:
    20
    Ok there is a simple way to do this. I just have to write the text with line breaks in a text editor and copy it into the field for the variable value.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you want to do it directly in Unity, use option-return.

    --Eric
     
  4. Eric

    Eric

    Joined:
    Nov 17, 2008
    Posts:
    20
    Ok, thank you.

    Unfortunately I don't work on a Mac at the moment. :)

    Is there also a shortcut on a Windows PC?
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    option = alt

    --Eric
     
  6. Eric

    Eric

    Joined:
    Nov 17, 2008
    Posts:
    20
    I know :)

    Forgot to say that alt-return doesn't work in Unity.