Ejemplo n.º 1
0
    /// <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
    }
Ejemplo n.º 2
0
 void Start()
 {
     mousedriver = new RawMouseDriver.RawMouseDriver();
     // Make the rigid body not change rotation
     if (rigidbody)
     {
         rigidbody.freezeRotation = true;
     }
 }
Ejemplo n.º 3
0
 void Start()
 {
     mouseDriver = new RawMouseDriver.RawMouseDriver();
     mice = new RawMouse[NUM_MICE];
     positions = new Vector2[NUM_MICE];
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     mousedriver = new RawMouseDriver.RawMouseDriver();
     mice = new RawMouse[NUM_MICE];
     move = new Vector2[NUM_MICE];
 }
Ejemplo n.º 5
0
    /// <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
    }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     mousedriver = new RawMouseDriver.RawMouseDriver();
 }