Interhaptics SDK for Unity 1.6
Loading...
Searching...
No Matches
Interhaptics.HapticMaterial Class Reference

Represents a haptic material, which is a ScriptableObject in Unity. This class is used to handle haptic effects data. More...

Inheritance diagram for Interhaptics.HapticMaterial:

Public Member Functions

override string ToString ()
 Overrides the default ToString method to return the haptic data text.
 

Static Public Member Functions

static HapticMaterial CreateInstanceFromString (string text)
 Creates an instance of HapticMaterial from a string.
 
static HapticMaterial CreateInstance (UnityEngine.TextAsset asset)
 Creates an instance of HapticMaterial from a Unity TextAsset.
 

Properties

string text [get]
 Publicly accessible property to get the haptic data text.
 

Detailed Description

Represents a haptic material, which is a ScriptableObject in Unity. This class is used to handle haptic effects data.

Definition at line 12 of file HapticMaterial.cs.

Member Function Documentation

◆ CreateInstance()

static HapticMaterial Interhaptics.HapticMaterial.CreateInstance ( UnityEngine.TextAsset asset)
static

Creates an instance of HapticMaterial from a Unity TextAsset.

Parameters
assetTextAsset containing haptic data.
Returns
A new instance of HapticMaterial created from the TextAsset.

Definition at line 41 of file HapticMaterial.cs.

42 {
43 return CreateInstanceFromString(asset.text);
44 }
static HapticMaterial CreateInstanceFromString(string text)
Creates an instance of HapticMaterial from a string.

References Interhaptics.HapticMaterial.CreateInstanceFromString().

Referenced by Interhaptics.HapticMaterial.CreateInstanceFromString().

◆ CreateInstanceFromString()

static HapticMaterial Interhaptics.HapticMaterial.CreateInstanceFromString ( string text)
static

Creates an instance of HapticMaterial from a string.

Parameters
textString containing haptic data.
Returns
A new instance of HapticMaterial with the specified text.

Definition at line 29 of file HapticMaterial.cs.

30 {
31 HapticMaterial hapticMaterial = CreateInstance<HapticMaterial>();
32 hapticMaterial.m_text = text;
33 return hapticMaterial;
34 }
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.

References Interhaptics.HapticMaterial.CreateInstance(), and Interhaptics.HapticMaterial.text.

Referenced by Interhaptics.HapticMaterial.CreateInstance().

◆ ToString()

override string Interhaptics.HapticMaterial.ToString ( )

Overrides the default ToString method to return the haptic data text.

Returns
The haptic data text.

Definition at line 50 of file HapticMaterial.cs.

51 {
52 return text;
53 }

References Interhaptics.HapticMaterial.text.

Property Documentation

◆ text

string Interhaptics.HapticMaterial.text
get

Publicly accessible property to get the haptic data text.

Definition at line 22 of file HapticMaterial.cs.

Referenced by Interhaptics.HapticMaterial.CreateInstanceFromString(), and Interhaptics.HapticMaterial.ToString().


The documentation for this class was generated from the following file: