• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ProjectCryken · Apr 25, 2013 at 04:29 PM · inspectornote

Adding notes to the inspector?

I found this: [http://wiki.unity3d.com/index.php?title=Notes][1]

It allows you to add notes, but only a one line note can be added (the text does not wrap). Can this be edited to allow more lines of writing?

Thanks [1]: http://wiki.unity3d.com/index.php?title=Notes

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by AlanMattano · Aug 29, 2014 at 01:38 AM

Just download this new free tool from the asset store. link: https://www.assetstore.unity3d.com/en/#!/content/51884

**strong text**Look this example: link: http://forum.unity3d.com/threads/add-info-text-notes-into-the-inspector.265330/

Make a C# script name InfoTextNote.

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 public class InfoTextNote : MonoBehaviour
 {
     public bool isReady = true;
     public string TextInfo = "Text here... " + "/n Lock when finish.";
 
     public void SwitchToggle ()
     {
         isReady = !isReady;
     }
 
     void Start ()
     {
         this.enabled = false; // Disable the component when the game start
     }
 }



Then make a folder and name it "Editor". In it make a new C# name AddInspectorText

 using UnityEngine;
 using System.Collections;    
 using UnityEditor;
 
 /* *Made by AlanMattano }} 2014* */
 
 [CustomEditor(typeof(InfoTextNote))]
 public class AddInspectorText : Editor {
 
 private int c = 0;
     private string buttonText = "Start Writting";
     private int MaxSizeInt = 5;
     private int[] IntArray = new int[] { 0, 1, 2, 3, 4 };
     private string[] MaxSizeString = new string[] { "Line Label", "Box Text ", "Box Info", "Box Warning", "Box Error" };
 
     
     public override void OnInspectorGUI()
     {
         InfoTextNote inMyScript = (InfoTextNote)target;    //
 
         if ( inMyScript.TextInfo == "Start writting text here... " +
             "/n Press Lock when finish." ) 
             ShowLogMessage() ;// se podria agregar alguna funcin en especial
 
         if ( !inMyScript.isReady ) {
             // The user is writing the text in this inspector editor.
 
             //DrawDefaultInspector();    // Unity function: add all is in the inspector
 
             switch (MaxSizeInt)
             {
             case 0:
                 if (EditorGUILayout.Toggle(inMyScript.isReady))inMyScript.SwitchToggle();                                    // Toggle
                 EditorGUILayout.LabelField(inMyScript.TextInfo);        // This is a small line text
                 break;
             case 1:
                 if ( GUILayout.Button(buttonText)) inMyScript.SwitchToggle();            // Button
                 EditorGUILayout.HelpBox(inMyScript.TextInfo, MessageType.None);            // This is a small box
                 break;
             case 2:
                 if ( GUILayout.Button(buttonText)) inMyScript.SwitchToggle();            // Button
                 EditorGUILayout.HelpBox(inMyScript.TextInfo, MessageType.Info);            // This is a help box
                 break;
             case 3:
                 if ( GUILayout.Button(buttonText)) inMyScript.SwitchToggle();            // Button
                 EditorGUILayout.HelpBox(inMyScript.TextInfo, MessageType.Warning);            // This is a Warning box
                 break;
             case 4:
                 if ( GUILayout.Button(buttonText)) inMyScript.SwitchToggle();            // Button
                 EditorGUILayout.HelpBox(inMyScript.TextInfo, MessageType.Error);            // This is a Error box
                 break;
             default:
                 if ( GUILayout.Button(buttonText)) inMyScript.SwitchToggle();            // Button
                 EditorGUILayout.HelpBox(inMyScript.TextInfo, MessageType.Info);            // This is a help box
                 break;
             }
         }else{
             // The user is writing the text in this inspector editor
 
             //DrawDefaultInspector();// for debug
 
             buttonText = "Lock !";
             // Button
             if ( GUILayout.Button(buttonText)) inMyScript.SwitchToggle();
 
 
             // Text
             inMyScript.TextInfo = EditorGUILayout.TextArea (inMyScript.TextInfo);
 
 
             // selection
             MaxSizeInt = EditorGUILayout.IntPopup("Text Type :", MaxSizeInt, MaxSizeString, IntArray);
 
             // warning
             EditorGUILayout.HelpBox( " Press LOCK at the top when finish. ", MessageType.Warning);            // This is a Warning box
         }
     }
 
     void ShowLogMessage() {
         c++;
         if (c==1) {
 
             Debug.Log (" Need to add text " + "\n");
         }
     }
 }

Then return to InfoTextNote and add it into the inspector.

Others in the community edit this answer. You can add corrections and improve this script

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by usergame · Mar 29, 2017 at 04:37 PM

I realize this is an old question but I was recently looking for a solution to this problem and didn't like the the suggested solutions, so I wrote my own simple PropertyDrawer and PropertyAttribute. Get more information at the forum post:

https://forum.unity3d.com/threads/helpattribute-allows-you-to-use-helpbox-in-the-unity-inspector-window.462768/

Hope this helps someone out who is still looking for a solution :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Notes or Bubble Window for Variables in Inspector Giving Help? 3 Answers

Scriptable Object won't Reset values after play. 1 Answer

How do I change inspector values of other game objects using a custom Editor Window 0 Answers

Make Button appear after a sudden amount of time 3 Answers

Display the same string in multiple text boxes 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges