AvatarCreationService
사용되지 않는 항목 표시
*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.
AvatarCreationService는 경험 내에서 아바타 생성을 유도하는 메서드를 제공하는 개발자 아바타 크리에이터를 지원하는 서비스입니다.
요약
메서드
자산이 UGC 유효성 검사를 통과하기 위해 준수해야 하는 규칙에 관한 데이터를 가져옵니다.
한 번에 아바타 생성 토큰 목록의 아바타 생성 토큰 세부 정보를 가져옵니다.
- PromptCreateAvatarAsync(tokenId : string,player : Player,humanoidDescription : HumanoidDescription):Tuple
에서 아바타를 구매하고 생성하도록 요청하고 에서 아바타를 가져옵니다.
- ValidateUGCAccessoryAsync(player : Player,accessory : Instance,accessoryType : Enum.AccessoryType):Tuple
스튜디오만. Enum.AccessoryType
스튜디오만. Enum.BodyPart
스튜디오만. 전체 신체대한 UGC 유효성 검사를 실행합니다.
이벤트
- AvatarModerationCompleted(outfitId : number,moderationStatus : Enum.ModerationStatus):RBXScriptSignal
속성
메서드
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
매개 변수
기본값: ""
기본값: ""