Interhaptics SDK for Unity 1.6
Loading...
Searching...
No Matches
HapticMaterial.cs
Go to the documentation of this file.
1/* ​
2* Copyright (c) 2023 Go Touch VR SAS. All rights reserved. ​
3* ​
4*/
5
6namespace Interhaptics
7{
12 public class HapticMaterial : UnityEngine.ScriptableObject
13 {
17 [UnityEngine.SerializeField, UnityEngine.HideInInspector]
18 private string m_text;
22 public string text => m_text;
23
30 {
32 hapticMaterial.m_text = text;
33 return hapticMaterial;
34 }
35
41 public static HapticMaterial CreateInstance(UnityEngine.TextAsset asset)
42 {
43 return CreateInstanceFromString(asset.text);
44 }
45
50 public override string ToString()
51 {
52 return text;
53 }
54
55 }
56
57}
Represents a haptic material, which is a ScriptableObject in Unity. This class is used to handle hapt...
override string ToString()
Overrides the default ToString method to return the haptic data text.
static HapticMaterial CreateInstanceFromString(string text)
Creates an instance of HapticMaterial from a string.
string text
Publicly accessible property to get the haptic data text.
static HapticMaterial CreateInstance(UnityEngine.TextAsset asset)
Creates an instance of HapticMaterial from a Unity TextAsset.