Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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.

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

Messing With Gradients At Runtime? 2 Answers

[Uni2D + Unity Inspector] Unity extremely slow, when a Sprite is selected 4 Answers

Inspector scripting, adding lists, checkboxes and buttons [With Image] 0 Answers

Assigning animations in inspector? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges