Added project
This commit is contained in:
30
Platformer/Assets/Editor/ItemBaseEditor.cs
Normal file
30
Platformer/Assets/Editor/ItemBaseEditor.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(ItemBase))]
|
||||
public class ItemBaseEditor : Editor {
|
||||
|
||||
private ItemBase _itemBase;
|
||||
|
||||
private void Awake() {
|
||||
_itemBase = (ItemBase) target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("New Item")) {
|
||||
_itemBase.CreateItem();
|
||||
}
|
||||
if (GUILayout.Button("Remove")) {
|
||||
_itemBase.RemoveItem();
|
||||
}
|
||||
if (GUILayout.Button("<=")) {
|
||||
_itemBase.PrevItem();
|
||||
}
|
||||
if (GUILayout.Button("=>")) {
|
||||
_itemBase.NextItem();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user