Exemple #1
0
    void UpdateCameraState(CameraState newState)
    {
        if (_currentState == newState)
        {
            return;
        }

        _activeControl = null;
        if (newState != CameraState.IDLE)
        {
            _activeControl = _transformControls[newState];
            _activeControl.Init(transform);
        }

        // Reset OrbitControl's orbit point if the previous camera state
        // was PAN or ROTATE. It can also be reset by zooming past the
        // orbit point but that's handled in OrbitControl's Init method.
        if (newState == CameraState.IDLE &&
            (_currentState == CameraState.PAN ||
             _currentState == CameraState.ROTATE))
        {
            _orbitControl.ResetOrbitPoint();
        }

        _currentState = newState;
    }
Exemple #2
0
 void Reset()
 {
     _currentState      = CameraState.IDLE;
     _activeMouseButton = MouseButton.NONE;
     _activeControl     = null;
 }