void Awake() { Input.compensateSensors = true; Input.gyro.enabled = true; _smoothingTime = smoothingTime; _headingOffset = headingOffset; _pitchOffset = pitchOffset; _pitchOffsetMinimum = pitchOffsetMinimum; _pitchOffsetMaximum = pitchOffsetMaximum; _gyroHeadingAmplifier = gyroHeadingAmplifier; _gyroPitchAmplifier = gyroPitchAmplifier; _selfUpdate = selfUpdate; _autoUpdateList.Clear(); _autoUpdateList = autoUpdateList; _transformName = transform.name; }
//================================================================================ void Update() { if (!SystemInfo.supportsGyroscope) { forceAccelerometer = true; ErrorHandling.LogError("Warning [GyroAccel]: No gyroscope available -> forcing accelerometer"); } if (Application.isEditor && Input.gyro.attitude == Quaternion.identity) { MSP_Input.ErrorHandling.LogError("Warning [GyroAccel]: There seems to be a problem reading the gyroscope: did you set up Unity Remote correctly?"); } // forceAccelerometer = _forceAccelerometer; smoothingTime = _smoothingTime; headingOffset = _headingOffset; pitchOffset = _pitchOffset; pitchOffsetMinimum = _pitchOffsetMinimum; pitchOffsetMaximum = _pitchOffsetMaximum; gyroHeadingAmplifier = _gyroHeadingAmplifier; gyroPitchAmplifier = _gyroPitchAmplifier; selfUpdate = _selfUpdate; autoUpdateList = _autoUpdateList; // CheckHeadingAndPitchBoundaries (); // if (!_forceAccelerometer && SystemInfo.supportsGyroscope) { UpdateGyroscopeOrientation (); } else { UpdateAccelerometerOrientation (); } // _rotation = rotation; _heading = heading; _pitch = pitch; _roll = roll; _headingOffset = headingOffset; _pitchOffset = pitchOffset; // }
//================================================================================ void Awake() { Input.compensateSensors = true; Input.gyro.enabled = true; _forceAccelerometer = forceAccelerometer; _smoothingTime = smoothingTime; _headingOffset = headingOffset; _pitchOffset = pitchOffset; _pitchOffsetMinimum = pitchOffsetMinimum; _pitchOffsetMaximum = pitchOffsetMaximum; _gyroHeadingAmplifier = gyroHeadingAmplifier; _gyroPitchAmplifier = gyroPitchAmplifier; _selfUpdate = selfUpdate; _autoUpdateList.Clear(); _autoUpdateList = autoUpdateList; _transformName = transform.name; }