Unity - Scripting API: Resources.LoadAll
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Declaration
public static Object[] LoadAll(string path);
Declaration
public static Object[] LoadAll(string path, Type systemTypeInstance);
Parameters
| Parameter | Description |
|---|---|
| path | Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. |
| systemTypeInstance | Type filter for objects returned. |
Description
Loads all assets in a folder or file at path in a Resources folder.
If path refers to a folder, all assets in the folder will be returned.
If path refers to a file, only that asset will be returned.
The path is relative to any Resources folder inside the Assets folder of your project.
Note: All asset names and paths in Unity use forward slashes. Paths using backslashes will not work.
Declaration
public static T[] LoadAll(string path);
Parameters
| Parameter | Description |
|---|---|
| path | Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. |
Description
Loads all assets in a folder or file at path in a Resources folder.
If path refers to a folder, all assets in the folder will be returned.
If path refers to a file, only that asset will be returned.
Only objects of type T will be returned.
The path is relative to any Resources folder inside the Assets folder of your project.
The script example below shows how LoadAll can be used with Linq.