Is there a way(like I see in many plug-ins) to have text or notes in the inspector amongst all the variables? For example I have a couple of lines of text above of variable to remind people what options they have for this variable?
I think you just mean the built in Attributes Unity have already set up?
See
and
Example code snippet:
[Header("Button Settings")]
[Tooltip("Arbitary text message")]
public string OnClickText = "";
[Tooltip("Useful GameObject you might need. Note there is a Sender property that is this class.")]
public GameObject Object;
For a general note on the component, create a new variable that has a [TextArea] Attribute.
[TextArea]
[Tooltip("Doesn't do anything. Just comments shown in inspector")]
public string Notes = "This component shouldn't be removed, it does important stuff.";
I realize this question is a few years old but I was recently looking to do the same and didn’t like the dummy variable suggestion, so I wrote my own really simple PropertyDrawer and HelpAttribute. More information at the forum post:
using UnityEngine;
[AddComponentMenu("Miscellaneous/README Info Note")]
public class CommentInformationNote : MonoBehaviour
{
[TextArea(10,1000)]
public string Comment = "Information Here.";
}
*. Place the script into the game object
*. Notice that you can use Add Component in the Inspector.
*. Do not change the script because you can loos all your data
*. DONE
ALTERNATIVE
After adding attributes to your script as MasterChiefLegend mention, you can create text notes in the inspector following these steps:
Hmmm, the reason I want this 'comment' above my variables is just to save time and for convenience. If all of that is required it would have the opposite effect :(
This is actually what i wanted to see possible, editable textfield i can add in some object in the scene to build a TODO list specific to scene. So it can’t be hardcoded in the C# file and has to be editable in editor.
I don't know about a way to do this, but it's been a wish of mine for some time: http://feedback.unity3d.com/unity/all-categories/1/hot/active/show-comments-for-variables-in-t
– alexanderbrevigHuh, I assume its something that can be done.
– ProjectCryken