Skip to content

Instantly share code, notes, and snippets.

@NNNIC
Created June 22, 2020 06:50
Show Gist options
  • Save NNNIC/5e77f87b26cbab1e55d6d6a16ccbb7ad to your computer and use it in GitHub Desktop.
Save NNNIC/5e77f87b26cbab1e55d6d6a16ccbb7ad to your computer and use it in GitHub Desktop.
Unity Simple Comment Component
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
This is a general purpose to add comments for GameObject
*/
public class _Comment : MonoBehaviour {
public string comment_0 = "Please Input a comment.";
}
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor(typeof(_Comment))]
public class _CommentEditor : Editor {
public override void OnInspectorGUI()
{
_Comment cmt = (_Comment)target;
cmt.comment_0 = EditorGUILayout.TextArea(cmt.comment_0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment