Avatar Editor Service
*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.
Tóm tắt
Phương Pháp
Sự Kiện
PromptCreateOutfitCompleted(result: Enum.AvatarPromptResult,failureType: Variant):RBXScriptSignal |
PromptSaveAvatarCompleted(result: Enum.AvatarPromptResult,humanoidDescription: HumanoidDescription):RBXScriptSignal |
Tài Liệu Tham Khảo API
Phương Pháp
Check Apply Default Clothing
Check Apply Default Clothing Async
Avatar Editor Service: Check Apply Default Clothing Async(humanoid Description:HumanoidDescription):HumanoidDescription
Tham Số
Lợi Nhuận
Conform To Avatar Rules
Conform To Avatar Rules Async
Avatar Editor Service: Conform To Avatar Rules Async(humanoid Description:HumanoidDescription):HumanoidDescription
Tham Số
Lợi Nhuận
Get Accessory Type
Tham Số
Lợi Nhuận
Get Avatar Rules
Get Batch Item Details
Get Batch Item Details Async
Tham Số
Lợi Nhuận
Get Bundles By Asset Id Async
Lợi Nhuận
Get Favorite
Get Favorite Async
Tham Số
Lợi Nhuận
Get Head Shapes Async
Lợi Nhuận
Mẫu mã
Lấy các hình dạng đầu đã sở hữu
local AvatarEditorService = game:GetService("AvatarEditorService")
-- Yêu cầu quyền truy cập đọc kho đồ
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
endGet Inventory
Get Inventory Async
Tham Số
Lợi Nhuận
Get Item Details
Get Item Details Async
Tham Số
Lợi Nhuận
Get Outfit Details
Get Outfit Details Async
Tham Số
Lợi Nhuận
Get Outfits
Get Outfits Async
Avatar Editor Service: Get Outfits Async(
Tham Số
| Giá Trị Mặc Định: All |
| Giá Trị Mặc Định: All |
Lợi Nhuận
Get Recommended Assets
Get Recommended Assets Async
Avatar Editor Service: Get Recommended Assets Async(
Tham Số
| Giá Trị Mặc Định: 0 |
Lợi Nhuận
Mẫu mã
Nhận Đề Xuất Mũ
local AvatarEditorService = game:GetService("AvatarEditorService")
local assets = AvatarEditorService:GetRecommendedAssetsAsync(Enum.AvatarAssetType.Hat, 9255093)
for _, asset in ipairs(assets) do
print(asset.Item.Name)
endGet Recommended Bundles
Get Recommended Bundles Async
Prompt Allow Inventory Read Access
Avatar Editor Service: Prompt Allow Inventory Read Access():()
Lợi Nhuận
()
Prompt Create Outfit
Avatar Editor Service: Prompt Create Outfit(
outfit:HumanoidDescription, rig Type:Enum.HumanoidRigType, outfit Options:Dictionary, outfit Type:Enum.OutfitType?
):()
Tham Số
| Giá Trị Mặc Định: nil |
Lợi Nhuận
()
Prompt Delete Outfit
Prompt Rename Outfit
Prompt Save Avatar
Avatar Editor Service: Prompt Save Avatar(
):()
Tham Số
Lợi Nhuận
()
Prompt Set Favorite
Avatar Editor Service: Prompt Set Favorite(
):()
Tham Số
Lợi Nhuận
()
Prompt Update Outfit
Avatar Editor Service: Prompt Update Outfit(
):()
Tham Số
Lợi Nhuận
()
Search Catalog
Search Catalog Async
Tham Số
Lợi Nhuận
Sự Kiện
Prompt Allow Inventory Read Access Completed
Avatar Editor Service. Prompt Allow Inventory Read Access Completed(result:Enum.AvatarPromptResult):RBXScriptSignal
Tham Số
Prompt Create Outfit Completed
Avatar Editor Service. Prompt Create Outfit Completed(
Tham Số
failureType:Variant |
Mẫu mã
Xử lý kết quả tạo trang phục
local AvatarEditorService = game:GetService("AvatarEditorService")
AvatarEditorService.PromptCreateOutfitCompleted:Connect(function(result, failureType)
if result == Enum.AvatarPromptResult.Success then
-- Trang phục đã được tạo
elseif result == Enum.AvatarPromptResult.PermissionDenied then
-- Người dùng đã từ chối lời nhắc; bỏ qua failureType
else -- Enum.AvatarPromptResult.Failed
if failureType == Enum.CreateOutfitFailure.OutfitLimitReached then
-- Thông báo cho người dùng rằng họ đã đạt giới hạn trang phục
elseif failureType == Enum.CreateOutfitFailure.InvalidName then
-- Thông báo cho người dùng chọn một tên khác
else -- Enum.CreateOutfitFailure.Other
-- Thất bại chung; thử lại hoặc hiển thị một lỗi chung
end
end
end)Prompt Delete Outfit Completed
Tham Số
Prompt Rename Outfit Completed
Tham Số
Prompt Save Avatar Completed
Avatar Editor Service. Prompt Save Avatar Completed(
Tham Số
Prompt Set Favorite Completed
Tham Số
Prompt Update Outfit Completed
Tham Số