private void Awake() { joy = GetComponent <JoystickListener> (); sprite = transform.Find("Sprite").GetComponent <SpriteRenderer> (); sprite.color = color; sprite.sortingOrder = JoystickManager.MAX_JOYSTICKS - joy.playerID; }
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); }
public JoystickUpdater(Joystick axis, JoystickListener parent) { Axis = axis; _parent = parent; }
public void SetListener(JoystickListener listener) { this._listener = listener; }