-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathContainerWidgetEditor.cs
More file actions
34 lines (28 loc) · 1.25 KB
/
Copy pathContainerWidgetEditor.cs
File metadata and controls
34 lines (28 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using UnityEditor;
using UnityEngine;
namespace OpenTibiaUnityEditor.Modules.Container
{
[CustomEditor(typeof(OpenTibiaUnity.Modules.Container.ContainerWidget), true)]
[CanEditMultipleObjects]
public class ContainerWidgetEditor : UI.Legacy.SidebarWidgetEditor
{
SerializedProperty _iconImage;
SerializedProperty _itemsScrollRect;
SerializedProperty _upButton;
protected override void OnEnable() {
base.OnEnable();
_iconImage = serializedObject.FindProperty("_iconImage");
_itemsScrollRect = serializedObject.FindProperty("_itemsScrollRect");
_upButton = serializedObject.FindProperty("_upButton");
}
public override void OnInspectorGUI() {
base.OnInspectorGUI();
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
EditorGUILayout.LabelField("Container Widget", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_iconImage, new GUIContent("Icon"));
EditorGUILayout.PropertyField(_itemsScrollRect, new GUIContent("Items ScrollRect"));
EditorGUILayout.PropertyField(_upButton, new GUIContent("UP Button"));
serializedObject.ApplyModifiedProperties();
}
}
}