protected override void Start()
        {
            base.Start();

            if (buttonGroup == null)
            {
                buttonGroup = GetComponent <KGUI_ButtonGroup>() ?? gameObject.AddComponent <KGUI_ButtonGroup>();
            }

            if (gridLayout == null)
            {
                gridLayout = gameObject.GetComponentInChildren <GridLayoutGroup>();
            }

            Template.SetActive(false);

            EventHandIdle.AddListener(OnButtonRelease, Core.ExecutionPriority.High);
            //CreatePanel();
            if (isTouchExpand)
            {
                onEnter.AddListener(OnExpand);
            }
            else
            {
                onClick.AddListener(OnExpand);
            }
        }
Exemple #2
0
        private void OnEnable()
        {
            EventHandGrip.AddListener(OnGrip);
            EventHandIdle.AddListener(OnIdle);

            MSwitchManager.AddListener(OnSwitch);
        }
Exemple #3
0
        /// <summary>
        /// 禁用
        /// </summary>
        public void OnDisable()
        {
            EventHandRays.RemoveListener(OnRay);
            EventHandIdle.RemoveListener(OnIdle);

            InputHand.IsEnable = false;

            UIOperate.IsEnable = false;
        }
Exemple #4
0
        protected override void Start()
        {
            base.Start();

            EventHandIdle.AddListener(OnButtonRelease, Core.ExecutionPriority.High);

            SetRectData();//进行刷新

            SetChangingValue(_value);
        }
Exemple #5
0
        /// <summary>
        /// 激活
        /// </summary>
        public void OnEnable()
        {
            if (InputHand == null)
            {
                return;
            }

            EventHandRays.AddListener(OnRay, ExecutionPriority.High);
            EventHandIdle.AddListener(OnIdle, ExecutionPriority.High);

            InputHand.IsEnable = true;

            UIOperate.IsEnable = true;
        }
Exemple #6
0
        /// <summary>
        /// 抬起
        /// </summary>
        public void SetIdle()
        {
            if (!isEnable)
            {
                return;
            }

            if (!isPressed)
            {
                return;
            }
            isPressed = false;

            HandStatus = MInputHandStatus.Idle;

            EventHandIdle.SendListener(HandIndex);
        }
Exemple #7
0
        protected override void Start()
        {
            base.Start();

            EventHandIdle.AddListener(OnButtonRelease, ExecutionPriority.High);

            //KinectEventHandIdle.AddListener(EventLevel.A, OnButtonRelease);

            if (sliderType == SliderType.Bar && !IsSetScroll)
            {
                SetRectData();
            }

            sumValue = Mathf.Abs(minValue - maxValue); //计算总长度

            SetChangingValue(Value);
        }
Exemple #8
0
 private void OnDisable()
 {
     EventHandGrip.RemoveListener(OnGrip);
     EventHandIdle.RemoveListener(OnIdle);
     MSwitchManager.RemoveListener(OnSwitch);
 }
Exemple #9
0
 protected override void OnDestroy()
 {
     EventHandIdle.RemoveListener(OnButtonRelease);
 }
Exemple #10
0
 public void Start()
 {
     EventHandGrip.AddListener(OnButtonPress);
     EventHandIdle.AddListener(OnButtonRelease);
     EventHandUIRay.AddListener(OnUIRay);
 }