/// <summary> /// Refreshes the mouse driver. /// Might need to be called when a new mouse is connected. /// </summary> public void Refresh() { #if UNITY_EDITOR_WIN || !UNITY_EDITOR // Mouse driver if (_mousedriver != null) { _mousedriver.Dispose(); } _mousedriver = new RawMouseDriver.RawMouseDriver(); // Values _mice = new RawMouse[NUM_MICE]; _move = new Vector2[NUM_MICE]; //_offset = new Vector2[NUM_MICE]; _scroll = new float[NUM_MICE]; //for (int i = 0; i < NUM_MICE; ++i) //{ // _move[i] = new Vector2(Camera.main.pixelWidth, Camera.main.pixelHeight)/2; //} // Buttons _prevMouse = new bool[NUM_BUTTONS][]; _mouseDown = new bool[NUM_BUTTONS][]; _mouseUp = new bool[NUM_BUTTONS][]; for (int b = 0; b < NUM_BUTTONS; ++b) { _prevMouse[b] = new bool[NUM_MICE]; _mouseDown[b] = new bool[NUM_MICE]; _mouseUp[b] = new bool[NUM_MICE]; } #endif }
void Start() { mousedriver = new RawMouseDriver.RawMouseDriver(); // Make the rigid body not change rotation if (rigidbody) { rigidbody.freezeRotation = true; } }
void Start() { mouseDriver = new RawMouseDriver.RawMouseDriver(); mice = new RawMouse[NUM_MICE]; positions = new Vector2[NUM_MICE]; }
// Use this for initialization void Start() { mousedriver = new RawMouseDriver.RawMouseDriver(); mice = new RawMouse[NUM_MICE]; move = new Vector2[NUM_MICE]; }
/// <summary> /// Refreshes the mouse driver. /// Might need to be called when a new mouse is connected. /// </summary> public void Refresh() { #if UNITY_EDITOR_WIN || !UNITY_EDITOR // Mouse driver if (_mousedriver != null) _mousedriver.Dispose(); _mousedriver = new RawMouseDriver.RawMouseDriver(); // Values _mice = new RawMouse[NUM_MICE]; _move = new Vector2[NUM_MICE]; //_offset = new Vector2[NUM_MICE]; _scroll = new float[NUM_MICE]; //for (int i = 0; i < NUM_MICE; ++i) //{ // _move[i] = new Vector2(Camera.main.pixelWidth, Camera.main.pixelHeight)/2; //} // Buttons _prevMouse = new bool[NUM_BUTTONS][]; _mouseDown = new bool[NUM_BUTTONS][]; _mouseUp = new bool[NUM_BUTTONS][]; for (int b = 0; b < NUM_BUTTONS; ++b) { _prevMouse[b] = new bool[NUM_MICE]; _mouseDown[b] = new bool[NUM_MICE]; _mouseUp[b] = new bool[NUM_MICE]; } #endif }
// Use this for initialization void Start() { mousedriver = new RawMouseDriver.RawMouseDriver(); }