Version: 2017.1
Experimental: this API is experimental and might be changed or removed in the future.

AssetImportContext.AddSubAsset

Cambiar al Manual
public void AddSubAsset (string identifier, Object asset);
public void AddSubAsset (string identifier, Object asset, Texture2D thumbnail);

Parámetros

identifier A unique identifier associated to this sub-Asset.
asset The Unity Object that is the sub-Asset.
thumbnail An optional 2D texture to use as the tumbnail for this sub-Asset.

Descripción

Adds a sub-Asset to the result of the import operation.

The sub-Asset is not a child of the main Asset, but a different Asset that was created alongside the main Asset. For example: when importing a texture as the main Asset, a sub-Asset could be a sprite. Note: You must make sure that your importer creates a unique identifier for each Asset. You must also make sure that your code regenerates the same identifier each time the file is re-imported, even if sub-Assets have been modified. This allows Unity to keep track of which old sub-Assets have been modified when a file is re-imported, and therefore which should be replaced by the corresponding new versions of the same sub-Assets. The identifier only needs to be unique within the context of the Asset file and not globaly unique across your whole project.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961