学习
引擎类
AvatarEditorService
无法创建
服务

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处


概要
方法
GetBatchItemDetails(itemIds: {any},itemType: Enum.AvatarItemType):{any}
已弃用
GetFavorite(itemId: number,itemType: Enum.AvatarItemType):boolean
已弃用
GetInventory(assetTypes: {any}):InventoryPages
已弃用
GetOutfitDetails(outfitId: number):Dictionary
已弃用
GetOutfits(outfitSource: Enum.OutfitSource,outfitType: Enum.OutfitType):OutfitPages
已弃用
GetRecommendedAssets(assetType: Enum.AvatarAssetType,contextAssetId: number):{any}
已弃用
GetRecommendedBundles(bundleId: number):{any}
已弃用
PromptCreateOutfit(outfit: HumanoidDescription,rigType: Enum.HumanoidRigType,outfitOptions: Dictionary,outfitType: Variant):()
PromptSetFavorite(itemId: number,itemType: Enum.AvatarItemType,shouldFavorite: boolean):()
SearchCatalog(searchParameters: CatalogSearchParams):CatalogPages
已弃用
继承成员

API 参考
方法
CheckApplyDefaultClothing
已弃用

CheckApplyDefaultClothingAsync
暂停
功能: AvatarAppearance
AvatarEditorService:CheckApplyDefaultClothingAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
参数
humanoidDescription:HumanoidDescription

ConformToAvatarRules
已弃用

ConformToAvatarRulesAsync
暂停
功能: AvatarAppearance
AvatarEditorService:ConformToAvatarRulesAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
参数
humanoidDescription:HumanoidDescription

GetAccessoryType
AvatarEditorService:GetAccessoryType(avatarAssetType:Enum.AvatarAssetType):Enum.AccessoryType
参数
avatarAssetType:Enum.AvatarAssetType

GetAvatarRules
已弃用

GetAvatarRulesAsync
暂停
AvatarEditorService:GetAvatarRulesAsync():Dictionary

GetBatchItemDetails
已弃用

GetBatchItemDetailsAsync
暂停
功能: AssetRead
AvatarEditorService:GetBatchItemDetailsAsync(
itemIds:{any}, itemType:Enum.AvatarItemType
参数
itemIds:{any}
返回

GetBundlesByAssetIdAsync
暂停
功能: AssetRead
AvatarEditorService:GetBundlesByAssetIdAsync(
assetId:number, limit:number
参数
assetId:number
limit:number
默认值:10

GetFavorite
已弃用

GetFavoriteAsync
暂停
功能: Players, AssetRead
AvatarEditorService:GetFavoriteAsync(
itemId:number, itemType:Enum.AvatarItemType
参数
itemId:number
返回

GetHeadShapesAsync
暂停
功能: Players, AssetRead
AvatarEditorService:GetHeadShapesAsync():{any}
返回
代码示例
获取拥有的头型
测试
local AvatarEditorService = game:GetService("AvatarEditorService")
AvatarEditorService:PromptAllowInventoryReadAccess()
local result = AvatarEditorService.PromptAllowInventoryReadAccessCompleted:Wait()
if result == Enum.AvatarPromptResult.Success then
local shapes = AvatarEditorService:GetHeadShapesAsync()
for i, shape in ipairs(shapes) do
print(i, shape)
end
end

GetInventory
已弃用

GetInventoryAsync
暂停
功能: Players, AssetRead
AvatarEditorService:GetInventoryAsync(assetTypes:{any}):InventoryPages
参数
assetTypes:{any}
代码示例
查找即将过期的物品
local AvatarEditorService = game:GetService("AvatarEditorService")
local pages = AvatarEditorService:GetInventoryAsync({ Enum.AvatarAssetType.Hat })
local currentPage = pages:GetCurrentPage()
for _, item in currentPage do
if item.ExpirationTime then
local secondsLeft = item.ExpirationTime.UnixTimestamp - DateTime.now().UnixTimestamp
local hoursLeft = math.floor(secondsLeft / 3600)
if hoursLeft < 24 then
warn(string.format("%s 在 %d 小时内过期", item.Name, hoursLeft))
end
end
end

GetItemDetails
已弃用

GetItemDetailsAsync
暂停
功能: AssetRead
AvatarEditorService:GetItemDetailsAsync(
itemId:number, itemType:Enum.AvatarItemType
参数
itemId:number
代码示例
检查物品过期
local AvatarEditorService = game:GetService("AvatarEditorService")
local details = AvatarEditorService:GetItemDetailsAsync(105589844216517, Enum.AvatarItemType.Asset)
if details.ExpirationTime then
local secondsLeft = details.ExpirationTime.UnixTimestamp - DateTime.now().UnixTimestamp
local hoursLeft = math.floor(secondsLeft / 3600)
if hoursLeft < 24 then
warn(details.Name .. " 在24小时内过期!")
end
end

GetOutfitDetails
已弃用

GetOutfitDetailsAsync
暂停
功能: AssetRead
AvatarEditorService:GetOutfitDetailsAsync(outfitId:number):Dictionary
参数
outfitId:number

GetOutfits
已弃用

GetOutfitsAsync
暂停
功能: Players, AssetRead
AvatarEditorService:GetOutfitsAsync(
outfitSource:Enum.OutfitSource, outfitType:Enum.OutfitType
参数
outfitSource:Enum.OutfitSource
默认值:"All"
outfitType:Enum.OutfitType
默认值:"All"

GetRecommendedAssets
已弃用

GetRecommendedAssetsAsync
暂停
功能: AssetRead
AvatarEditorService:GetRecommendedAssetsAsync(
assetType:Enum.AvatarAssetType, contextAssetId:number
参数
contextAssetId:number
默认值:0
返回
代码示例
获取帽子推荐
local AvatarEditorService = game:GetService("AvatarEditorService")
local assets = AvatarEditorService:GetRecommendedAssetsAsync(Enum.AvatarAssetType.Hat, 9255093)
for _, asset in ipairs(assets) do
print(asset.Item.Name)
end

GetRecommendedBundles
已弃用

GetRecommendedBundlesAsync
暂停
功能: AssetRead
AvatarEditorService:GetRecommendedBundlesAsync(bundleId:number):{any}
参数
bundleId:number
返回

PromptAllowInventoryReadAccess
功能: Players, AssetRead
AvatarEditorService:PromptAllowInventoryReadAccess():()
返回
()

PromptCreateOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptCreateOutfit(
outfit:HumanoidDescription, rigType:Enum.HumanoidRigType, outfitOptions:Dictionary, outfitType:Variant
):()
参数
outfitOptions:Dictionary
默认值:"nil"
outfitType:Variant
返回
()

PromptDeleteOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptDeleteOutfit(outfitId:number):()
参数
outfitId:number
返回
()

PromptRenameOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptRenameOutfit(outfitId:number):()
参数
outfitId:number
返回
()

PromptSaveAvatar
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptSaveAvatar(
humanoidDescription:HumanoidDescription, rigType:Enum.HumanoidRigType
):()
参数
humanoidDescription:HumanoidDescription
返回
()

PromptSetFavorite
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptSetFavorite(
itemId:number, itemType:Enum.AvatarItemType, shouldFavorite:boolean
):()
参数
itemId:number
shouldFavorite:boolean
返回
()

PromptUpdateOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptUpdateOutfit(
outfitId:number, updatedOutfit:HumanoidDescription, rigType:Enum.HumanoidRigType
):()
参数
outfitId:number
updatedOutfit:HumanoidDescription
返回
()

SearchCatalog
已弃用

SearchCatalogAsync
暂停
功能: AssetRead
AvatarEditorService:SearchCatalogAsync(searchParameters:CatalogSearchParams):CatalogPages
参数
searchParameters:CatalogSearchParams
代码示例
搜索带有定时选项的物品
local AvatarEditorService = game:GetService("AvatarEditorService")
local params = CatalogSearchParams.new()
params.SalesTypeFilter = Enum.SalesTypeFilter.TimedOptions
params.Limit = 10
local pages = AvatarEditorService:SearchCatalogAsync(params)
local results = pages:GetCurrentPage()
for _, item in results do
if item.TimedOptions then
for _, option in item.TimedOptions do
local days = option.Duration / 86400
print(string.format("%s: %d 天, %d R$", item.Name, days, option.Price))
end
end
end

活动
PromptAllowInventoryReadAccessCompleted
功能: Players, AssetRead
AvatarEditorService.PromptAllowInventoryReadAccessCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptCreateOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptCreateOutfitCompleted(
result:Enum.AvatarPromptResult, failureType:Variant
参数
failureType:Variant

PromptDeleteOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptDeleteOutfitCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptRenameOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptRenameOutfitCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptSaveAvatarCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptSaveAvatarCompleted(
result:Enum.AvatarPromptResult, humanoidDescription:HumanoidDescription
参数
humanoidDescription:HumanoidDescription

PromptSetFavoriteCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptSetFavoriteCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptUpdateOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptUpdateOutfitCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

©2026 Roblox Corporation、Roblox、Roblox 标志及 Powering Imagination 是我们在美国及其他国家或地区的注册与未注册商标。