跳至正文
版本:bleeding-edge 🩸

🍀 资产

从资产包中检索资产数据。

🗿Static Class
This is a Static Class. Access it's methods directly with .. It's not possible to spawn new instances.
💂Authority
This static class can be accessed on both 🟧 Client and 🟦 Server side.
🧑‍💻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)

🗿 静态函数

ReturnsNameDescription
table of tableGetAnimations获取包含资产包中所有动画资产键的列表
table of tableGetAssetPacks获取包含所有已加载资产包信息的列表
stringGetAssetPath获取资产的文件路径
table of tableGetBlueprints获取包含资产包中所有蓝图资产键的列表
table of tableGetMaps获取包含资产包中所有地图资产键的列表
table of tableGetMaterials获取包含资产包中所有材质资产键的列表
table of tableGetOthers获取包含资产包中所有其他资产键的列表
table of tableGetParticles获取包含资产包中所有粒子资产键的列表
table of tableGetSkeletalMeshes获取包含资产包中所有骨骼网格体资产键的列表
table of tableGetSounds获取包含资产包中所有声音资产键的列表
table of tableGetStaticMeshes获取包含资产包中所有静态网格体资产键的列表
Precache手动添加一个资产,使其在玩家的加载屏幕期间进行加载

GetAnimations

获取包含资产包中所有动画资产键的列表
local ret = Assets.GetAnimations(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetAssetPacks

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

Returns

TypeDescription
table of tablewith this format

GetAssetPath

获取资产的文件路径
local ret = Assets.GetAssetPath(asset, asset_type)

Parameters

TypeParameterDefaultDescription
stringasset Required parameter 格式为 asset-pack::AssetKey 的资产引用
AssetTypeasset_type Required parameter 资产类型

Returns

TypeDescription
stringAssets.toml 中定义的文件路径

GetBlueprints

获取包含资产包中所有蓝图资产键的列表
local ret = Assets.GetBlueprints(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetMaps

获取包含资产包中所有地图资产键的列表
local ret = Assets.GetMaps(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetMaterials

获取包含资产包中所有材质资产键的列表
local ret = Assets.GetMaterials(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetOthers

获取包含资产包中所有其他资产键的列表
local ret = Assets.GetOthers(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetParticles

获取包含资产包中所有粒子资产键的列表
local ret = Assets.GetParticles(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetSkeletalMeshes

获取包含资产包中所有骨骼网格体资产键的列表
local ret = Assets.GetSkeletalMeshes(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetSounds

获取包含资产包中所有声音资产键的列表
local ret = Assets.GetSounds(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

GetStaticMeshes

获取包含资产包中所有静态网格体资产键的列表
local ret = Assets.GetStaticMeshes(asset_pack_path)

Parameters

TypeParameterDefaultDescription
stringasset_pack_path Required parameter 用于获取资产的资产包路径

Returns

TypeDescription
table of table包含所有资产及其元数据的表数组 with this format

Precache

手动添加一个资产,使其在玩家的加载屏幕期间进行加载
Assets.Precache(asset_path, asset_type)

Parameters

TypeParameterDefaultDescription
stringasset_path Required parameter 资产键
AssetTypeasset_type Required parameter 资产类型
Assets.Precache Examples
Precaches a Static Mesh
Assets.Precache("my-asset-pack::SM_MyStaticMesh", AssetType.StaticMesh)