17 double[] transientTester = { 0.02, 1.0, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0 };
19 double[] amplitude = { 0.0, 1.0, 2.5, 1.0 };
20 double[] pitch = { 0.0, 0.0, 1.5, 1.0, 2.5, 0.0 };
21 double[]
transient = { 3.0, 1.0, 1.0, 4.0, 1.0, 1.0 , 4.5, 1.0, 1.0};
26 if (Input.GetKeyDown(KeyCode.K))
31 if (Input.GetKeyDown(KeyCode.I))
36 if (Input.GetKeyDown(KeyCode.U))
41 if (Input.GetKeyDown(KeyCode.J))
46 if (Input.GetKeyDown(KeyCode.H))
51 if (Input.GetKeyDown(KeyCode.M))
56 if (Input.GetKeyDown(KeyCode.L))
62 if (Input.GetKeyDown(KeyCode.O))
66 if (Input.GetKeyDown(KeyCode.P))
71 if (Input.GetKeyDown(KeyCode.Alpha0))
76 for (
int i = 1; i <= 9; i++)
78 if (Input.GetKeyDown(KeyCode.Alpha0 + i))
80 HapticPreset.Play((HapticPreset.PresetType)(i - 1));
88 if (myHapticMaterial !=
null)
90 HAR.PlayHapticEffect(myHapticMaterial);
91 Debug.Log(
"Haptic effect played successfully!");
95 Debug.LogError(
"Haptic material is not assigned!");
100 HAR.PlayConstant(0.5, 0.5);
105 double[] amplitude = { 0.0, 0.5, 0.5, 0.5 };
107 HAR.PlayConstant(0.5, 0.5, 1, 2,
LateralFlag.Global);
112 HAR.PlayConstant(1.0, 5.0, _controllerSide:
LateralFlag.Right);
116 HAR.PlayAdvanced(amplitude, pitch, HAR.DEFAULT_FREQ_MIN, HAR.DEFAULT_FREQ_MAX,
transient, 1.0, 2);
126 double amplitude = 1.0;
135 HAR.PlayTransient(time, amplitude, pitch,
intensity, loops, controllerSide);
142 double[]
transient = {
148 HAR.PlayTransients(
transient);
154 double[]
transient = {
160 HAR.PlayTransients(
transient, 1.0, 2,
LateralFlag.Global);
166 HAR.Play(
new double[] { 0, 1, 1, 0.0, 2, 1 });
171 double[] amplitude = { 0, 1, 1, 0.0, 2, 1 };
179 double[] amplitude = {
184 double[]
transient = {
188 HAR.Play(amplitude,
transient, 1.0, 1,
LateralFlag.Global);
194 double[] amplitude = {
199 double[]
transient = {
203 HAR.Play(amplitude,
transient, 1.0, 2,
LateralFlag.Global);
209 double[] amplitudes = {
218 HAR.PlayAdvanced(amplitudes, pitch);
224 double[] amplitudes = {
233 HAR.PlayAdvanced(amplitudes, pitch, 65, 300,
null, 1.0, 2,
LateralFlag.Global);
239 double[] amplitudes = {
253 double[] transients = {
259 HAR.PlayAdvanced(amplitudes, pitch, _fmin, _fmax, transients);
265 double[] amplitudes = {
279 double[] transients = {
285 HAR.PlayAdvanced(amplitudes, pitch, _fmin, _fmax, transients, 1.0, 2,
LateralFlag.Global);
292 double[] amplitudes = {
303 HAR.PlayAdvanced(amplitudes, pitch, _fmin, _fmax,
null, 1.0, 1,
LateralFlag.Global);
308 HapticPreset.Play((HapticPreset.PresetType)(i));
312#if UNITY_ANDROID && !UNITY_EDITOR
319 HAR.MobileCancelHaptics();
LateralFlag
Enumeration for lateral flag in haptic command data.