Textmeshextension

From Unify Community Wiki
Revision as of 20:55, 7 April 2014 by Diego Floor (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

In the current version of Unity (4.3.4) the component TextMesh contains a text field that does not accept enter as new line. This script creates a new field, above the standard, that allows new lines to be entered by pressing enter.

NOTE: This class is only necessary if you are unable to create new lines by pressing shift+enter; See the Textmeshextension Talk page for details.

Script and Usage

Create a script named "TextMeshExtension.js" with the contents as shown below and place it inside the "Editor" folder.

 
@CustomEditor (TextMesh)
class TextMeshExtension extends Editor{
    function OnInspectorGUI () {
        target.text = EditorGUILayout.TextArea(target.text);
        DrawDefaultInspector();
    }
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox