123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using UnityEngine;
- [ExecuteInEditMode]
- [AddComponentMenu("NGUI/Interaction/Button Keys (Legacy)")]
- public class UIButtonKeys : UIKeyNavigation
- {
- protected override void OnEnable()
- {
- this.Upgrade();
- base.OnEnable();
- }
- public void Upgrade()
- {
- if (this.onClick == null && this.selectOnClick != null)
- {
- this.onClick = this.selectOnClick.gameObject;
- this.selectOnClick = null;
- NGUITools.SetDirty(this);
- }
- if (this.onLeft == null && this.selectOnLeft != null)
- {
- this.onLeft = this.selectOnLeft.gameObject;
- this.selectOnLeft = null;
- NGUITools.SetDirty(this);
- }
- if (this.onRight == null && this.selectOnRight != null)
- {
- this.onRight = this.selectOnRight.gameObject;
- this.selectOnRight = null;
- NGUITools.SetDirty(this);
- }
- if (this.onUp == null && this.selectOnUp != null)
- {
- this.onUp = this.selectOnUp.gameObject;
- this.selectOnUp = null;
- NGUITools.SetDirty(this);
- }
- if (this.onDown == null && this.selectOnDown != null)
- {
- this.onDown = this.selectOnDown.gameObject;
- this.selectOnDown = null;
- NGUITools.SetDirty(this);
- }
- }
- public UIButtonKeys selectOnClick;
- public UIButtonKeys selectOnUp;
- public UIButtonKeys selectOnDown;
- public UIButtonKeys selectOnLeft;
- public UIButtonKeys selectOnRight;
- }
|