Contents

loadAsync(contentsOf:withName:options:)

Asynchronously loads a texture resource from a URL with options.

Declaration

@MainActor @preconcurrency static func loadAsync(contentsOf url: URL, withName resourceName: String? = nil, options: TextureResource.CreateOptions) -> LoadRequest<TextureResource>

Parameters

  • url:

    The path or address of the file to load.

  • resourceName:

    A unique name the method assigns to the resource it loads, for use in network synchronization.

  • options:

    A configuration for generating the texture.

Return Value

A load operation that publishes the resource.

Discussion

RealityKit uses the resource name to distinguish resources locally, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate.

See Also

Deprecated