private void Awake()
 {
     joy                 = GetComponent <JoystickListener> ();
     sprite              = transform.Find("Sprite").GetComponent <SpriteRenderer> ();
     sprite.color        = color;
     sprite.sortingOrder = JoystickManager.MAX_JOYSTICKS - joy.playerID;
 }
예제 #2
0
 public JoystickManager()
 {
     joystick = null;
     joystickGuid = Guid.Empty;
     _listener = null;
     _running = false;
     _logListener = null;
     _worker = new BackgroundWorker();
     _worker.WorkerReportsProgress = false;
     _worker.WorkerSupportsCancellation = true;
     _worker.DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs args) {
         while (_running) {
             DoPoll();
             Thread.Sleep(1);
         }
     });
 }
예제 #3
0
 public JoystickManager()
 {
     joystick     = null;
     joystickGuid = Guid.Empty;
     _listener    = null;
     _running     = false;
     _logListener = null;
     _worker      = new BackgroundWorker();
     _worker.WorkerReportsProgress      = false;
     _worker.WorkerSupportsCancellation = true;
     _worker.DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs args) {
         while (_running)
         {
             DoPoll();
             Thread.Sleep(1);
         }
     });
 }
 public void AddJoystickListener(JoystickListener listener)
 {
     AddAnalogListener(listener.XListener, listener.XId);
     AddAnalogListener(listener.YListener, listener.YId);
 }
예제 #5
0
 public JoystickUpdater(Joystick axis, JoystickListener parent)
 {
     Axis    = axis;
     _parent = parent;
 }
예제 #6
0
 public void SetListener(JoystickListener listener)
 {
     this._listener = listener;
 }
예제 #7
0
 public void SetListener(JoystickListener listener)
 {
     this._listener = listener;
 }