Exemple #1
0
 public void Press(JoystickController _sender)
 {
     if (OnPressedEventHandler != null)
     {
         OnPressedEventHandler(_sender);
         //OnPressed(_sender);
     }
     OnPressed(_sender);
 }
Exemple #2
0
 /// <summary>
 /// add by given loaction
 /// </summary>
 /// <param name="_hor"></param>
 /// <param name="_vet"></param>
 /// <param name="_controller"></param>
 public void Add(JoystickController _controller)
 {
     try
     {
         if (_controllers[_controller.LocationVertical][_controller.LocationHorizontal])
         {
         }
         _controllers[_controller.LocationVertical][_controller.LocationHorizontal] = _controller;
     }
     catch (Exception)
     {
     }
 }
Exemple #3
0
        /// <summary>
        /// search up
        /// </summary>
        /// <returns></returns>
        public JoystickController SearchForUp()
        {
            int _vet = _pointerVertical;

            while (_vet > 0)
            {
                _vet--;

                // 检查当前指针有没有
                _handledJoystick = _controllers[_vet][_pointerHorizital];
                if (_handledJoystick && _handledJoystick.Enabled)
                {
                    this.Current = _handledJoystick;
                    return(_handledJoystick);
                }

                // 向左搜索
                _handledJoystick = doSearchLeft(_vet);

                // 如果向左没有搜索到就向右所搜
                if (_handledJoystick != null)
                {
                    return(_handledJoystick);
                }
                else
                {
                    _handledJoystick = doSearchRight(_vet);
                }

                // 如果右边有则返回右边,没有则继续下一层
                if (_handledJoystick != null)
                {
                    return(_handledJoystick);
                }
            }

            _handledJoystick = null;
            return(null);
        }
Exemple #4
0
 public void Remove(JoystickController _controller)
 {
     Remove(_controller.LocationVertical, _controller.LocationHorizontal);
 }
Exemple #5
0
 public virtual void OnPressed(JoystickController _sender)
 {
 }