Esempio n. 1
0
        public override void Start()
        {
            base.Start();

            eventClick += delegate(UIComponent component, UIMouseEventParameter eventParam)
            {
                if (CurrentListeningButton == this)
                    CurrentListeningButton = null;
                else
                    CurrentListeningButton = this;
            };
        }
Esempio n. 2
0
        public override void Start()
        {
            base.Start();

            eventClick += delegate(UIComponent component, UIMouseEventParameter eventParam)
            {
                if (CurrentListeningButton == this)
                {
                    CurrentListeningButton = null;
                }
                else
                {
                    CurrentListeningButton = this;
                }
            };
        }
Esempio n. 3
0
        public override void Update()
        {
            base.Update();

            if (!isVisible)
            {
                if (CurrentListeningButton == this)
                {
                    CurrentListeningButton = null;
                }

                return;
            }

            if (CurrentListeningButton == this)
            {
                text = "Press key (Click to cancel) ...";
            }
            else
            {
                text = AssignedKey.ToString();
            }

            //This logic is separate from ui logic!
            if (CurrentListeningButton == this)
            {
                if (Input.GetKeyDown(KeyCode.Escape))
                {
                    CurrentListeningButton = null;
                    return;
                }

                foreach (KeyCode key in validKeyCodes)
                {
                    if (Input.GetKeyDown(key))
                    {
                        AssignedKey = key;
                        CurrentListeningButton = null;
                        return;
                    }
                }
            }
        }
Esempio n. 4
0
        public override void Update()
        {
            base.Update();

            if (!isVisible)
            {
                if (CurrentListeningButton == this)
                {
                    CurrentListeningButton = null;
                }

                return;
            }

            if (CurrentListeningButton == this)
            {
                text = "Press key (Click to cancel) ...";
            }
            else
            {
                text = AssignedKey.ToString();
            }

            //This logic is separate from ui logic!
            if (CurrentListeningButton == this)
            {
                if (Input.GetKeyDown(KeyCode.Escape))
                {
                    CurrentListeningButton = null;
                    return;
                }

                foreach (KeyCode key in validKeyCodes)
                {
                    if (Input.GetKeyDown(key))
                    {
                        AssignedKey            = key;
                        CurrentListeningButton = null;
                        return;
                    }
                }
            }
        }