[Unity] API learning-->Resources resource class

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:

  • LoadLoad an asset of the requested type stored in the resource folder path
  • LoadAllLoad all assets in the folder or file in the path in the resources folder
  • LoadAsyncAsynchronously load assets stored at paths in the Resources folder
  • UnloadAssetUnload assetToUnload from memory
  • UnloadUnusedAssetsUnload unused assets
  • FindObjectsOfTypeAllreturns a list of all objects of type T
  • InstanceIDToObjectConvert an instance ID to an object reference.
  • InstanceIDToObjectListConvert an array of instance IDs to a list of object references

Guess you like

Origin blog.csdn.net/ainklg/article/details/129787586