r2mods/ilspy_dump/ror2_csproj/RoR2.GamepadVibration/VibrationContext.cs

20 lines
455 B
C#

namespace RoR2.GamepadVibration;
public struct VibrationContext
{
public CameraRigController cameraRigController;
public LocalUser localUser;
public float userVibrationScale;
public float CalcCamDisplacementMagnitude()
{
if (!cameraRigController || !Run.instance || !Run.instance.isRunning || localUser.cachedMasterController.master.lostBodyToDeath)
{
return 0f;
}
return cameraRigController.rawScreenShakeDisplacement.magnitude;
}
}