Partager via


ControllerModel.TryGetControllerModel(UInt64) Method

Definition

Provides a byte stream representing the glTF model of the controller, if available.

public System.Threading.Tasks.Task<byte[]> TryGetControllerModel (ulong modelKey);
member this.TryGetControllerModel : uint64 -> System.Threading.Tasks.Task<byte[]>
Public Function TryGetControllerModel (modelKey As ULong) As Task(Of Byte())

Parameters

modelKey
UInt64

The unique key representing the desired controller's model. Can be queried using TryGetControllerModelKey(UInt64).

Returns

Task<Byte[]>

Task that triggers once the controller model stream is loaded, yielding the stream or null if there is no model available.

Remarks

Needs to be passed into a glTF parser/loader to convert into a Unity GameObject. This method allocates a byte buffer on every successful call. It's recommended to either cache it or the resulting GameObject locally instead of calling this multiple times.

Applies to