mirror of
https://github.com/lllyasviel/YGOProUnity_V2.git
synced 2026-10-20 07:59:06 +08:00
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
//----------------------------------------------
|
|
// NGUI: Next-Gen UI kit
|
|
// Copyright © 2011-2015 Tasharen Entertainment
|
|
//----------------------------------------------
|
|
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
[CanEditMultipleObjects]
|
|
#if UNITY_3_5
|
|
[CustomEditor(typeof(UIKeyNavigation))]
|
|
#else
|
|
[CustomEditor(typeof(UIKeyNavigation), true)]
|
|
#endif
|
|
public class UIKeyNavigationEditor : Editor
|
|
{
|
|
public override void OnInspectorGUI ()
|
|
{
|
|
GUILayout.Space(6f);
|
|
NGUIEditorTools.SetLabelWidth(120f);
|
|
|
|
serializedObject.Update();
|
|
NGUIEditorTools.DrawProperty("Starts Selected", serializedObject, "startsSelected");
|
|
NGUIEditorTools.DrawProperty("Constraint", serializedObject, "constraint");
|
|
|
|
if (NGUIEditorTools.DrawHeader("Override"))
|
|
{
|
|
NGUIEditorTools.SetLabelWidth(60f);
|
|
NGUIEditorTools.BeginContents();
|
|
NGUIEditorTools.DrawProperty("Left", serializedObject, "onLeft");
|
|
NGUIEditorTools.DrawProperty("Right", serializedObject, "onRight");
|
|
NGUIEditorTools.DrawProperty("Up", serializedObject, "onUp");
|
|
NGUIEditorTools.DrawProperty("Down", serializedObject, "onDown");
|
|
NGUIEditorTools.DrawProperty("OnClick", serializedObject, "onClick");
|
|
|
|
if (serializedObject.isEditingMultipleObjects || (target as UIKeyNavigation).GetComponent<UIInput>() != null)
|
|
NGUIEditorTools.DrawProperty("Tab", serializedObject, "onTab");
|
|
|
|
NGUIEditorTools.EndContents();
|
|
}
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
}
|