loadAsync(named:in:)
Returns a load request that creates a texture resource by asynchronously loading it from a bundle.
Declaration
@MainActor @preconcurrency static func loadAsync(named name: String, in bundle: Bundle? = nil) -> LoadRequest<TextureResource>Parameters
- name:
The name of the resource. The filename extension is optional.
- bundle:
The bundle to search for the resource. Use
nilto indicate the app’s bundle.
Return Value
A load operation that publishes the resource.
Discussion
RealityKit automatically creates a resource name for the texture resource based on the values of name and bundle. RealityKit uses the resource name to identify resources, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate.
See init(named:in:) for an example of optimally loading textures with other content.