Public API
This page documents the new public API facade classes:
CharacterCreatorAPI(runtime core)CharacterCreatorDemoAPI(demo UI helpers)
Runtime API (CharacterCreatorAPI)
CharacterCreatorAPI)Source:
Assets/Arawn/CrystalCharacterCreator/Runtime/CharacterCreatorAPI.cs
Add to character root:
Character Creator APIcomponent
What it wraps
EquipmentManagerBlendshapeSynchronizerCharacterPresetManagerbody
SkinnedMeshRendereroptional
BodyPartLengthAdjuster(reflection-based in runtime assembly)
Reference / Binding
TryResolveReferences()TryResolveReferences(GameObject root, bool includeChildren = true)Bind(EquipmentManager, BlendshapeSynchronizer, CharacterPresetManager, SkinnedMeshRenderer, MonoBehaviour)GetOrAdd(GameObject characterRoot)
Equipment Methods
ToggleEquipment(GameObject prefab, EquipmentSlot slot)Equip(GameObject prefab, EquipmentSlot slot)UnequipSlot(EquipmentSlot slot)UnequipItem(GameObject equippedObject, EquipmentSlot slot)IsSlotEquipped(EquipmentSlot slot)IsPrefabEquipped(GameObject prefab, EquipmentSlot slot)GetEquippedItem(GameObject prefab, EquipmentSlot slot)GetEquippedItems(EquipmentSlot slot)GetEquippedEquipmentIDs()SetEquippedEquipmentIDs(List<string> ids)
Preset Methods
BuildScopedPresetKey(string key)CapturePreset(string presetName = "New Preset")SavePreset(string key, string presetName = null)LoadAndApplyPreset(string key)ApplyPreset(CharacterPreset preset)LoadPreset(string key)DeletePreset(string key)GetSavedPresetKeys()LoadPortrait(string key)CapturePortrait(string key)SetPresetProvider(MonoBehaviour providerBehaviour)(expectsICharacterPresetProvider)
Blendshape / Body Scale Methods
SetBodyBlendshapeWeight(string blendshapeName, float weight, bool syncEquipment = true)SetBodyBlendshapeWeight(int blendshapeIndex, float weight, bool syncEquipment = true)TryGetBodyBlendshapeWeight(string blendshapeName, out float weight)SyncBlendshapesNow()AdjustBodyPartLength(string partType, float multiplier)TryGetBodyPartLength(string partType, out float multiplier)ResetBodyPartLengths()SetUniformScale(float uniformScale)GetUniformScale()
Demo API (CharacterCreatorDemoAPI)
CharacterCreatorDemoAPI)Source:
Assets/Arawn/CrystalCharacterCreator/Demo/Scripts/CharacterCreatorDemoAPI.cs
Add to a scene controller or UI root:
Character Creator Demo APIcomponent
What it wraps
CharacterCreatorDemoUICharacterPresetGalleryUIoptional
CharacterCreatorAPI
Methods
TryResolveReferences()BindDemoUIToCharacterRoot(GameObject characterRoot, bool rebuildUI = true)BindDemoUIToCharacterAPI(bool rebuildUI = true)SetPresetGalleryManager(CharacterPresetManager presetManager, bool refresh = true)BindPresetGalleryToCharacterRoot(GameObject characterRoot, bool refresh = true)RebuildDemoUI()RefreshPresetGallery()SetDefaultHeadMeshes(GameObject defaultHairObject, GameObject defaultFaceObject, bool rebuildUI = false)
Minimal Usage Example
Notes
Use
CharacterCreatorAPIfor gameplay/runtime systems.Use
CharacterCreatorDemoAPIwhen you need to control demo canvases/UI binding.For spawned characters, always bind using the spawned instance root.
Last updated