- Resources.Load
- Success!
- Submission failed
- Description
- Declaration
- Parameters
- Returns
- Description
- Declaration
- Declaration
- Parameters
- Returns
- Description
- Resources.Load
- Success!
- Submission failed
- Description
- Parameters
- Returns
- Description
- Parameters
- Returns
- Description
- Resources.Load
- Успех!
- Ошибка внесения изменений
- Параметры
- Описание
- Параметры
- Описание
- Resources.Load
- Parameters
- Returns
- Description
- Parameters
- Returns
- Description
- Resources.Load
- Parameters
- Returns
- Description
- Parameters
- Returns
- Description
Resources.Load
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 try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Loads the asset of the requested type stored at path in a Resources folder.
This method returns the asset at path if it can be found, otherwise it returns null.
Note that the path is case insensitive and must not contain a file extension. All asset names and paths in Unity use forward slashes, so using backslashes in the path will not work.
The path is relative to any folder named Resources inside the Assets folder of your project. More than one Resources folder can be used. If you have multiple Resources folders you cannot duplicate the use of an asset name.
For example, a project may have Resources folders called Assets / Resources/ and Assets / Guns / Resources/ . The path does not need to include Assets and Resources in the string, for example loading a GameObject at Assets / Guns / Resources / Shotgun.prefab would only require Shotgun as the path . Also, if Assets / Resources / Guns / Missiles / PlasmaGun.prefab exists it can be loaded using Guns / Missiles / PlasmaGun as the path string.
If you have multiple Resources folders you cannot duplicate the use of an asset name.
Declaration
Parameters
path | Path to the target resource to load. |
Returns
T An object of the requested generic parameter type.
Description
Loads the asset of the requested type stored at path in a Resources folder using a generic parameter type filter of type T .
This method returns the asset at path if it can be found and if its type matches the requested generic parameter type, otherwise it returns null. You can use this overload to reduce type conversion in your code by providing a generic type parameter. This allows Unity to perform the C# type conversion for you.
Declaration
Declaration
Parameters
path | Path to the target resource to load. |
systemTypeInstance | Type filter for objects returned. |
Returns
Object The requested asset returned as an Object.
Description
Loads an asset stored at path in a Resources folder using an optional systemTypeInstance filter.
This method returns the asset at path if it can be found and if its type matches the optional systemTypeInstance parameter, otherwise it returns null.
You may need to cast the returned object to the actual associated C# type of the asset in order to access its methods and properties, or use it with other Unity APIs.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright ©2021 Unity Technologies. Publication Date: 2021-11-26.
Источник
Resources.Load
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 try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Loads the asset of the requested type stored at path in a Resources folder.
This method returns the asset at path if it can be found, otherwise it returns null.
Note that the path is case insensitive and must not contain a file extension. All asset names and paths in Unity use forward slashes, so using backslashes in the path will not work.
The path is relative to any folder named Resources inside the Assets folder of your project. More than one Resources folder can be used. If you have multiple Resources folders you cannot duplicate the use of an asset name.
For example, a project may have Resources folders called Assets / Resources/ and Assets / Guns / Resources/ . The path does not need to include Assets and Resources in the string, for example loading a GameObject at Assets / Guns / Resources / Shotgun.prefab would only require Shotgun as the path . Also, if Assets / Resources / Guns / Missiles / PlasmaGun.prefab exists it can be loaded using Guns / Missiles / PlasmaGun as the path string.
If you have multiple Resources folders you cannot duplicate the use of an asset name.
Parameters
path | Path to the target resource to load. |
Returns
T An object of the requested generic parameter type.
Description
Loads the asset of the requested type stored at path in a Resources folder using a generic parameter type filter of type T .
This method returns the asset at path if it can be found and if its type matches the requested generic parameter type, otherwise it returns null. You can use this overload to reduce type conversion in your code by providing a generic type parameter. This allows Unity to perform the C# type conversion for you.
Parameters
path | Path to the target resource to load. |
systemTypeInstance | Type filter for objects returned. |
Returns
Object The requested asset returned as an Object.
Description
Loads an asset stored at path in a Resources folder using an optional systemTypeInstance filter.
This method returns the asset at path if it can be found and if its type matches the optional systemTypeInstance parameter, otherwise it returns null.
You may need to cast the returned object to the actual associated C# type of the asset in order to access its methods and properties, or use it with other Unity APIs.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright © 2020 Unity Technologies. Publication Date: 2021-03-24.
Источник
Resources.Load
Успех!
Благодарим вас за то, что вы помогаете нам улучшить качество документации по Unity. Однако, мы не можем принять любой перевод. Мы проверяем каждый предложенный вами вариант перевода и принимаем его только если он соответствует оригиналу.
Ошибка внесения изменений
По определённым причинам предложенный вами перевод не может быть принят. Пожалуйста попробуйте снова через пару минут. И выражаем вам свою благодарность за то, что вы уделяете время, чтобы улучшить документацию по Unity.
Параметры
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. |
Описание
Loads an asset stored at path in a Resources folder.
Returns the asset at path if it can be found otherwise returns null. Only objects of type will be returned if this parameter is supplied. The path is relative to any Resources folder inside the Assets folder of your project, extensions must be omitted.
Note:
All asset names & paths in Unity use forward slashes, paths using backslashes will not work.
Параметры
path | Pathname of the target folder. When using the empty string (i.e., «»), the function will load the entire contents of the Resources folder. |
Описание
Loads an asset stored at path in a Resources folder.
Returns the asset at path if it can be found otherwise returns null. Only objects of type T will be returned. The path is relative to any Resources folder inside the Assets folder of your project, extensions must be omitted.
Note:
All asset names & paths in Unity use forward slashes, paths using backslashes will not work.
Источник
Resources.Load
Parameters
path | Path to the target resource to load. |
Returns
T The requested asset’s Type.
Description
Loads an asset stored at path in a folder called Resources.
If an asset can be found at path , it is returned with type T , otherwise returns null. If the file at path is of a type that cannot be converted to T , also returns null. The path is relative to any folder named Resources inside the Assets folder of your project. More than one Resources folder can be used. For example, a project may have Resources folders called Assets/Resources and @@Assets Assets Resources@@. The path does not need to include Assets and Resources in the string, for example loading a GameObject at @@Assets path Shotgun.prefab@@ would only require Shotgun as the path . Also, if @@Assets path Missiles/PlasmaGun.prefab exists it can be loaded using Guns path PlasmaGun@@ as the path string. If you have multiple Resources folders you cannot duplicate the use of an asset name.
Note: Extensions must be omitted.
Note: All asset names and paths in Unity use forward slashes, paths using backslashes will not work.
Parameters
path | Path to the target resource to load. When using an empty string (i.e., «»), the function loads the entire contents of the Resources folder. |
systemTypeInstance | Type filter for objects returned. |
Returns
Object The requested asset returned as an Object.
Description
Loads an asset stored at path in a Resources folder.
Returns the asset at path if it can be found, otherwise returns null. If the type parameter is specified, only objects of this type are returned. The path is relative to any Resources folder inside the Assets folder of your project, extensions must be omitted.
Note: All asset names and paths in Unity use forward slashes, paths using backslashes will not work.
Источник
Resources.Load
Parameters
path | Pathname of the target folder. |
Returns
T The requested asset returned as a Type.
Description
Loads an asset stored at path in a folder called Resources.
Returns the asset at path if it can be found otherwise returns null. Only an object of type T will be returned. The path is relative to any folder named Resources inside the Assets folder of your project. More than one Resources folder can be used. For example, a project may have Resources folders called Assets/Resources and Assets/Guns/Resources . String names that include Assets and Resources are not needed. For example the loading of a GameObject at Assets/Guns/Resources/Shotgun.prefab does not use the folder names. Also, if Assets/Resources/Guns/Missiles/PlasmaGun.prefab exists it will be loaded using Prefabs/Missiles/PlasmaGun . If you have multiple Resources folders you cannot duplicate use of an asset name.
Another example of the Resources folder. In Resources there are two files, fancyA and fancyB . Resources also has Resources2 folder. This folder contains two files, fancyA2 and fancyB2 . Finally, Resources2 has a folder called Resources3 with a single file also called fancyB . (This means the file in Resources3 has the same name as in Resources .) The files in Resources can be loaded as fancyA and fancyB with no need for the folder hierarchy Assets/Resources . Also, the files in Resources2 can be loaded. Loading these require the folder directory so an example load will be Resources2/fancyB2 . Finally, loading from Resources3 will be Resources2/Resources3/fancyB .
Note: Extensions must be omitted.
Note: All asset names and paths in Unity use forward slashes, paths using backslashes will not work.
Parameters
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. |
Returns
Object The requested asset returned as an Object.
Description
Loads an asset stored at path in a Resources folder.
Returns the asset at path if it can be found otherwise returns null. Only objects of type will be returned if this parameter is supplied. The path is relative to any Resources folder inside the Assets folder of your project, extensions must be omitted.
Note: All asset names and paths in Unity use forward slashes, paths using backslashes will not work.
Источник