Class Vibrator
Declaration
public class Vibrator : Module<Vibrator, VibratorConfig, VibratorDebugger>
Properties
Logger
Declaration
public override ILog Logger { get; }
Enabled
To enable/disable the vibrator.
Declaration
public static bool Enabled { get; set; }
CanVibrate
If the device can vibrate.
Declaration
public static bool CanVibrate { get; }
Methods
Initialize(Action<InitializationResult>)
Declaration
protected override void Initialize(Action<InitializationResult> setResult)
Parameters
Type | Name |
---|---|
System.Action<InitializationResult> | setResult |
Vibrate(float, float)
Vibrates the device once with given intensity, sharpness.
Declaration
public static bool Vibrate(float intensity, float sharpness)
Returns
System.Boolean
: If vibration is successful.
Parameters
Type | Name | Description |
---|---|---|
System.Single | intensity | Intensity of the vibration. |
System.Single | sharpness | Sharpness of the vibration. Note: This parameter won't work on Android devices. |
Vibrate(float, float, float)
Vibrates the device with given intensity, sharpness and duration.
Declaration
public static bool Vibrate(float duration, float intensity, float sharpness)
Returns
System.Boolean
: If vibration is successful.
Parameters
Type | Name | Description |
---|---|---|
System.Single | duration | Duration of the vibration. |
System.Single | intensity | Intensity of the vibration. |
System.Single | sharpness | Sharpness of the vibration. Note: This parameter won't work on Android devices. |
Vibrate(UIVibrationType)
Vibrates the device once with given type.
Declaration
public static bool Vibrate(UIVibrationType type)
Returns
System.Boolean
: If vibration is successful.
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.VibrationModule.UIVibrationType | type | Type of the vibration. Based on Apple.CoreHaptics. |
Vibrate(UIVibrationPreset)
Vibrates the device with given preset.
Declaration
public static bool Vibrate(UIVibrationPreset preset)
Returns
System.Boolean
: If vibration is successful.
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.VibrationModule.UIVibrationPreset | preset | Predefined sequence of vibration. Based on Apple.CoreHaptics. |
Vibrate(params UIVibrationSequence[])
Vibrates the device with given sequence.
Declaration
public static void Vibrate(params UIVibrationSequence[] sequence)
Parameters
Type | Name | Description |
---|---|---|
MatchinghamGames.VibrationModule.UIVibrationSequence[] | sequence | Sequence of vibration. |
Cancel()
Stops current vibration
Declaration
public static void Cancel()