ResourcePreloader
A node used to preload sub-resources inside a scene.
A node used to preload sub-resources inside a scene.
This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. You can add the resources using the ResourcePreloader tab when the node is selected.
C# has a simplified @C#.preload built-in method which can be used in most situations, leaving the use of ResourcePreloader for more advanced scenarios.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
ResourcePreloaderConstructor
public ResourcePreloader();Properties1
ResourcesProperty
public Reckfell.Collections.Array Resources { get; set; }Methods6
AddResourcevoid
public void AddResource(StringName name, Resource resource);Adds a resource to the preloader with the given name. If a resource with the given name already exists, the new resource will be renamed to "name N" where N is an incrementing number starting from 2.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
resource | Resource | — |
GetResourceResource
public Resource GetResource(StringName name);Returns the resource associated to name.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
ResourceGetResourceListstring[]
public string[] GetResourceList();Returns the list of resources inside the preloader.
string[]HasResourcebool
public bool HasResource(StringName name);Returns true if the preloader contains a resource associated to name.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolRemoveResourcevoid
public void RemoveResource(StringName name);Removes the resource associated to name from the preloader.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RenameResourcevoid
public void RenameResource(StringName name, StringName newname);Renames a resource inside the preloader from name to newname.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
newname | StringName | — |