TeslasuitDocumentation
Plugins

Assets

Classes#

TsAssetBase#

TsAssetBase

Base class for Teslasuit asset (*.ts_asset) file.

Properties

Bytes — byte[] (read-only)

Asset file bytes.

AssetType — TsAssetType (read-only)

Teslasuit asset type.

Instance — IAsset (read-only)

Returns an asset instance.

Fields

m_bytes byte[]

m_assetType TsAssetType

m_instance TsAssetInstance

Methods

Create#

TsAssetBase Create(byte[] bytes);

Creates asset instance from byte array.

Parameters

bytes: byte[]

Asset bytes

Returns: TsAssetBase

TsAssetBase Scriptable object instance


Load#

IAsset Load();

Loads an asset from bytes and creates IAsset in memory.

Returns: IAsset

IAsset asset handle


GetAssetType#

TsAssetType GetAssetType(byte[] bytes);

Returns Asset type by given asset bytes.

Parameters

bytes: byte[]

Asset bytes

Returns: TsAssetType



TsAssetInstance#

TsAssetInstance

Runtime Asset representation.

Once instantiated, TsAssetInstance lifetime is managed by unity.

Properties

Asset — IAsset (read-only)

Asset reference represented by this instance.

Fields

m_asset IAsset

Methods

Create#

TsAssetInstance Create(Func< IAsset > assetCreator);

Creates Asset instance.

Parameters

assetCreator: Func< IAsset >

Functor, used to create IAsset.

Returns: TsAssetInstance


OnDestroy#

void OnDestroy();


TsHapticAnimationAsset#

TsHapticAnimationAsset

Haptic animation asset.

Used for static animation playback.


TsHapticEffectAsset#

TsHapticEffectAsset

Haptic effect asset.

Can be used for Haptic material asset.


TsHapticMaterialAsset#

TsHapticMaterialAsset

Haptic material used to create IHapticMaterial playable.

Fields

m_hapticEffect TsHapticEffectAsset

m_touchSequence TsTouchSequenceAsset

Methods

Load#

override IAsset Load();

Loads an asset from bytes and creates IAsset in memory.

Returns: override IAsset

IAsset asset handle



TsTouchSequenceAsset#

TsTouchSequenceAsset

Touch sequence asset.

Can be used for Haptic material asset or IDynamicPlayable playback.