Last active
April 8, 2019 16:53
-
-
Save XakazukinX/053611c749ce6220db78a259dc580687 to your computer and use it in GitHub Desktop.
インスペクタに説明とその記述者を残せるスクリプト
This file contains hidden or 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 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