Interhaptics SDK for Unity 1.6
Loading...
Searching...
No Matches
EventHapticManagerMobile.cs
Go to the documentation of this file.
1/* ​
2* Copyright (c) 2023 Go Touch VR SAS. All rights reserved. ​
3* ​
4*/
5
7using System.Collections.Generic;
8using UnityEngine;
9
11{
12 public class EventHapticManagerMobile : MonoBehaviour
13 {
14 [SerializeField]
15 private List<EventHapticSource> eventHapticSources;
16
18 {
19 foreach (EventHapticSource eventHapticSource in eventHapticSources)
20 {
21 if (eventHapticSource.isPlaying)
22 {
23 Core.HAR.StopEvent(eventHapticSource.HapticMaterialId);
24 if (eventHapticSource.playingCoroutine != null)
25 {
26 eventHapticSource.StopCoroutine(eventHapticSource.playingCoroutine);
27 }
28 eventHapticSource.playingCoroutine = null;
29 eventHapticSource.isPlaying = false;
30 break;
31 }
32 }
33 }
34 }
35}
Haptic source that plays a haptic effect when triggered by an event. Plays the haptic effect on the s...