🍀 资产
从资产包中检索资产数据。
🗿Static Class
This is a Static Class. Access it's methods directly with
.. It's not possible to spawn new instances.🧑💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
🎒 示例
(Assets.Precache) Precaches a Static Mesh
Assets.Precache("my-asset-pack::SM_MyStaticMesh", AssetType.StaticMesh)
🗿 静态函数
| Returns | Name | Description | |
|---|---|---|---|
| table of table | GetAnimations | 获取包含资产包中所有动画资产键的列表 | |
| table of table | GetAssetPacks | 获取包含所有已加载资产包信息的列表 | |
| string | GetAssetPath | 获取资产的文件路径 | |
| table of table | GetBlueprints | 获取包含资产包中所有蓝图资产键的列表 | |
| table of table | GetMaps | 获取包含资产包中所有地图资产键的列表 | |
| table of table | GetMaterials | 获取包含资产包中所有材质资产键的列表 | |
| table of table | GetOthers | 获取包含资产包中所有其他资产键的列表 | |
| table of table | GetParticles | 获取包含资产包中所有粒子资产键的列表 | |
| table of table | GetSkeletalMeshes | 获取包含资产包中所有骨骼网格体资产键的列表 | |
| table of table | GetSounds | 获取包含资产包中所有声音资产键的列表 | |
| table of table | GetStaticMeshes | 获取包含资产包中所有静态网格体资产键的列表 | |
Precache | 手动添加一个资产,使其在玩家的加载屏幕期间进行加载 |

GetAnimations
获取包含资产包中所有动画资产键的列表
local ret = Assets.GetAnimations(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetAssetPacks
获取包含所有已加载资产包信息的列表
local ret = Assets.GetAssetPacks()

GetAssetPath
获取资产的文件路径
local ret = Assets.GetAssetPath(asset, asset_type)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset | Required parameter | 格式为 asset-pack::AssetKey 的资产引用 |
| AssetType | asset_type | Required parameter | 资产类型 |
Returns
| Type | Description |
|---|---|
| string | Assets.toml 中定义的文件路径 |

GetBlueprints
获取包含资产包中所有蓝图资产键的列表
local ret = Assets.GetBlueprints(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetMaps
获取包含资产包中所有地图资产键的列表
local ret = Assets.GetMaps(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetMaterials
获取包含资产包中所有材质资产键的列表
local ret = Assets.GetMaterials(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetOthers
获取包含资产包中所有其他资产键的列表
local ret = Assets.GetOthers(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetParticles
获取包含资产包中所有粒子资产键的列表
local ret = Assets.GetParticles(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetSkeletalMeshes
获取包含资产包中所有骨骼网格体资产键的列表
local ret = Assets.GetSkeletalMeshes(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetSounds
获取包含资产包中所有声音资产键的列表
local ret = Assets.GetSounds(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

GetStaticMeshes
获取包含资产包中所有静态网格体资产键的列表
local ret = Assets.GetStaticMeshes(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | 用于获取资产的资产包路径 |

Precache
手动添加一个资产,使其在玩家的加载屏幕期间进行加载
Assets.Precache(asset_path, asset_type)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_path | Required parameter | 资产键 |
| AssetType | asset_type | Required parameter | 资产类型 |
Assets.Precache Examples
Precaches a Static Mesh
Assets.Precache("my-asset-pack::SM_MyStaticMesh", AssetType.StaticMesh)