Added lots of examples for editor customization
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data.Editor
|
||||
{
|
||||
[CustomEditor(typeof(CharacterAttributes))]
|
||||
public class CharacterAttributesEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
if (GUILayout.Button("Open Character Attributes Window"))
|
||||
{
|
||||
CharacterAttributesWindow window = (CharacterAttributesWindow)EditorWindow.GetWindow(typeof(CharacterAttributesWindow));
|
||||
window.CharacterAttributesToEdit = target as CharacterAttributes;
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user