Class Effects
A singleton for managing juicy effects. Also handles the settings for reducing discomfort from certain effects. i.e. a player can disable screen shake if it affects them.
public static class Effects
- Inheritance
-
Effects
- Inherited Members
Fields
FILE_PATH
private const string FILE_PATH = "effects.json"
Field Value
Properties
MaxRumbleDuration
The maximum rumble allowed for rumbling controllers (clamped)
public static float MaxRumbleDuration { get; set; }
Property Value
MaxScreenShakeDuration
The maximum amount of screen shake allowed.
public static float MaxScreenShakeDuration { get; set; }
Property Value
RumbleStrength
The default strength at which to rumble controllers at
public static float RumbleStrength { get; set; }
Property Value
ScreenShakeStrength
The default strength at which the screen shakes
public static float ScreenShakeStrength { get; set; }
Property Value
Methods
Load()
public static void Load()
Rumble(float, float, float, int)
public static void Rumble(float strong, float weak, float duration = 0.1, int controller_id = -1)
Parameters
SaveSettings()
public static void SaveSettings()
Shake(float, float, float)
Triggers a screen shake
public static void Shake(float speed, float strength, float duration)
Parameters
speed
floatthe speed at which to shake (higher means faster side to side)
strength
floatthe strength at which to shake (higher means shaking moves the camera further
duration
floatthe duration of time in seconds to perform this screen shake
Events
RequestScreenShake
Event for when screen shake is requested. Parameters are: speed, strength, duration. Strength and Duration are adjusted to meet the settings of the user.
public static event Action<float, float, float> RequestScreenShake