Skip to content

Instantly share code, notes, and snippets.

@XakazukinX
Last active April 8, 2019 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XakazukinX/053611c749ce6220db78a259dc580687 to your computer and use it in GitHub Desktop.
Save XakazukinX/053611c749ce6220db78a259dc580687 to your computer and use it in GitHub Desktop.
インスペクタに説明とその記述者を残せるスクリプト
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class Description : MonoBehaviour
{
[TextArea(1,6)]
public string comment = "ここにスクリプトとかの説明文を書いてください\n";
public string author = "ななし";
}
[CustomEditor (typeof(Description))]
public class DescriptionInspector : Editor
{
Description _description = null;
void OnEnable ()
{
//Character コンポーネントを取得
_description = (Description) target;
}
public override void OnInspectorGUI ()
{
EditorGUILayout.LabelField ("スクリプトの説明を書いたりする用です");
base.OnInspectorGUI ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment