Ejemplo n.º 1
0
        public override void SubmitControlState(ulong updateTick, float deltaTime)
        {
            if (currentTouch == null && allowSlideToggle)
            {
                ButtonState = false;
                var touchCount = TouchManager.TouchCount;
                for (var i = 0; i < touchCount; i++)
                {
                    ButtonState = ButtonState || button.Contains(TouchManager.GetTouch(i));
                }
            }

            SubmitButtonState(target, ButtonState, updateTick, deltaTime);
        }
Ejemplo n.º 2
0
        public override void SubmitControlState(ulong updateTick)
        {
            if (currentTouch == null && allowSlideToggle)
            {
                state = false;
                var touchCount = TouchManager.TouchCount;
                for (int i = 0; i < touchCount; i++)
                {
                    state = state || Contains(TouchManager.ScreenToWorldPoint(TouchManager.GetTouch(i).position));
                }
            }

            SubmitButtonState(target, state, updateTick);
        }
Ejemplo n.º 3
0
        public override void SubmitControlState(ulong updateTick, float deltaTime)
        {
#if !(UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2)
            if (pressureSensitive)
            {
                var buttonValue = 0.0f;
                if (currentTouch == null)
                {
                    if (allowSlideToggle)
                    {
                        var touchCount = TouchManager.TouchCount;
                        for (var i = 0; i < touchCount; i++)
                        {
                            var touch = TouchManager.GetTouch(i);
                            if (button.Contains(touch))
                            {
                                buttonValue = Utility.Max(buttonValue, touch.NormalizedPressure);
                            }
                        }
                    }
                }
                else
                {
                    buttonValue = currentTouch.NormalizedPressure;
                }

                ButtonState = buttonValue > 0.0f;
                SubmitButtonValue(target, buttonValue, updateTick, deltaTime);
                return;
            }
#endif

            if (currentTouch == null && allowSlideToggle)
            {
                ButtonState = false;
                var touchCount = TouchManager.TouchCount;
                for (var i = 0; i < touchCount; i++)
                {
                    ButtonState = ButtonState || button.Contains(TouchManager.GetTouch(i));
                }
            }

            SubmitButtonState(target, ButtonState, updateTick, deltaTime);
        }
Ejemplo n.º 4
0
 public override void SubmitControlState(ulong updateTick, float deltaTime)
 {
     if (pressureSensitive)
     {
         float num = 0f;
         if (currentTouch == null)
         {
             if (allowSlideToggle)
             {
                 int touchCount = TouchManager.TouchCount;
                 for (int i = 0; i < touchCount; i++)
                 {
                     Touch touch = TouchManager.GetTouch(i);
                     if (button.Contains(touch))
                     {
                         num = Utility.Max(num, touch.normalizedPressure);
                     }
                 }
             }
         }
         else
         {
             num = currentTouch.normalizedPressure;
         }
         ButtonState = (num > 0f);
         SubmitButtonValue(target, num, updateTick, deltaTime);
         return;
     }
     if (currentTouch == null && allowSlideToggle)
     {
         ButtonState = false;
         int touchCount2 = TouchManager.TouchCount;
         for (int j = 0; j < touchCount2; j++)
         {
             ButtonState = (ButtonState || button.Contains(TouchManager.GetTouch(j)));
         }
     }
     SubmitButtonState(target, ButtonState, updateTick, deltaTime);
 }