Created
June 22, 2020 06:50
-
-
Save NNNIC/5e77f87b26cbab1e55d6d6a16ccbb7ad to your computer and use it in GitHub Desktop.
Unity Simple Comment Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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