AvatarCreationService
แสดงที่เลิกใช้งานแล้ว
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
AvatarCreationService เป็นบริการที่สนับสนุนผู้สร้างอวตารนักพัฒนา โดยให้วิธีที่สนับสนุนการเรียกใช้การสร้างอวตารจากภายในประสบการณ์
สรุป
วิธีการ
รับข้อมูลเกี่ยวกับกฎที่สินทรัพย์ต้องปฏิบัติตามเพื่อผ่านการตรวจสอบ UGC
รับรายละเอียดโทเค็นการสร้างอวตารสำหรับรายการโทเค็นการสร้างอวตารในครั้งเดียว
- PromptCreateAvatarAsync(tokenId : string,player : Player,humanoidDescription : HumanoidDescription):Tuple
ขอให้ Player ซื้อและสร้างอวตารจาก HumanoidDescription
- ValidateUGCAccessoryAsync(player : Player,accessory : Instance,accessoryType : Enum.AccessoryType):Tuple
สตูดิโอเท่านั้น ทำการตรวจสอบ UGC สําหรับ Enum.AccessoryType
สตูดิโอเท่านั้น ทำการตรวจสอบ UGC สําหรับ Enum.BodyPart
สตูดิโอเท่านั้น ทำการตรวจสอบ UGC สําหรับร่างกายทั้งหมด
เหตุการณ์
- AvatarModerationCompleted(outfitId : number,moderationStatus : Enum.ModerationStatus):RBXScriptSignal
คุณสมบัติ
วิธีการ
GenerateAvatar2DPreviewAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ส่งค่ากลับ
LoadAvatar2DPreviewAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ส่งค่ากลับ
LoadGeneratedAvatarAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ส่งค่ากลับ
PromptCreateAvatarAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""
ส่งค่ากลับ
ตัวอย่างโค้ด
PromptCreateAvatarAsync
local AvatarCreationService = game:GetService("AvatarCreationService")
export type BodyPartInfo = {
bodyPart: Enum.BodyPart,
instance: Instance, --Folder with Created MeshParts
}
export type BodyPartList = { BodyPartInfo }
local function publishAvatar(bodyPartInstances: BodyPartList, player: Player, tokenId: string)
local humanoidDescription = Instance.new("HumanoidDescription")
for _, bodyPartInfo in bodyPartInstances do
local bodyPartDescription = Instance.new("BodyPartDescription")
bodyPartDescription.Instance = bodyPartInfo.instance
bodyPartDescription.BodyPart = bodyPartInfo.bodyPart
bodyPartDescription.Parent = humanoidDescription
end
local pcallSuccess, result, resultMessage = pcall(function()
return AvatarCreationService:PromptCreateAvatarAsync(tokenId, player, humanoidDescription)
end)
if pcallSuccess then
if result == Enum.PromptCreateAvatarResult.Success then
print("Successfully uploaded with BundleId: ", resultMessage)
else
print("Unsuccessfully uploaded with error message:", resultMessage)
end
else
print("Avatar failed to create.")
end
end
ValidateUGCAccessoryAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""
ส่งค่ากลับ
ValidateUGCBodyPartAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""
ส่งค่ากลับ
ValidateUGCFullBodyAsync
พารามิเตอร์
ค่าเริ่มต้น: ""
ค่าเริ่มต้น: ""