introduce
In Unity, the files in the resource bundle can be accessed through the Resources class
Instructions:
Load<T>(String path)
- Generic, specifying the file type
- After the path, pass parameters to find the path (
- The file needs to be in
Assets/ Resources /
the specified path
Common methods:
Load
Load an asset of the requested type stored in the resource folder pathLoadAll
Load all assets in the folder or file in the path in the resources folderLoadAsync
Asynchronously load assets stored at paths in the Resources folderUnloadAsset
Unload assetToUnload from memoryUnloadUnusedAssets
Unload unused assetsFindObjectsOfTypeAll
returns a list of all objects of type TInstanceIDToObject
Convert an instance ID to an object reference.InstanceIDToObjectList
Convert an array of instance IDs to a list of object references