loadAsync(contentsOf:withName:)
Asynchronously loads a texture resource from a URL.
Declaration
@MainActor @preconcurrency static func loadAsync(contentsOf url: URL, withName resourceName: String? = nil) -> 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.
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.