This commit is contained in:
2020-07-04 14:41:25 +08:00
parent 70c346d2c1
commit a8f02e4da5
3748 changed files with 587372 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
//----------------------------------------------
// NGUI: Next-Gen UI kit
// Copyright © 2011-2015 Tasharen Entertainment
//----------------------------------------------
using UnityEngine;
/// <summary>
/// Deprecated component. Use UIKeyNavigation instead.
/// </summary>
[ExecuteInEditMode]
[AddComponentMenu("NGUI/Interaction/Button Keys (Legacy)")]
public class UIButtonKeys : UIKeyNavigation
{
public UIButtonKeys selectOnClick;
public UIButtonKeys selectOnUp;
public UIButtonKeys selectOnDown;
public UIButtonKeys selectOnLeft;
public UIButtonKeys selectOnRight;
protected override void OnEnable ()
{
Upgrade();
base.OnEnable();
}
public void Upgrade ()
{
if (onClick == null && selectOnClick != null)
{
onClick = selectOnClick.gameObject;
selectOnClick = null;
NGUITools.SetDirty(this);
}
if (onLeft == null && selectOnLeft != null)
{
onLeft = selectOnLeft.gameObject;
selectOnLeft = null;
NGUITools.SetDirty(this);
}
if (onRight == null && selectOnRight != null)
{
onRight = selectOnRight.gameObject;
selectOnRight = null;
NGUITools.SetDirty(this);
}
if (onUp == null && selectOnUp != null)
{
onUp = selectOnUp.gameObject;
selectOnUp = null;
NGUITools.SetDirty(this);
}
if (onDown == null && selectOnDown != null)
{
onDown = selectOnDown.gameObject;
selectOnDown = null;
NGUITools.SetDirty(this);
}
}
}