Code examples
Example for change settings
More: SwitchCharacterSettings(string settingsname)
DemoScript.cs
using UnityEngine;
using AdvancedPeopleSystem;
public class DemoScript : MonoBehaviour
{
public CharacterCustomization character;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Q))
{
var selectors = character.GetCharacterSettingsSelectors(); // (1)!
CharacterSettingsSelector maleSettings = selectors.Find(f => f.name == "Male"); // (2)!
CharacterSettingsSelector femaleSettings = selectors.Find(f => f.name == "Female"); // (3)!
if (maleSettings != null && femaleSettings != null)
character.SwitchCharacterSettings( (character.Settings == maleSettings.settings) ? femaleSettings.name : maleSettings.name); // (4)!
}
}
}
- Get Settings
- Male settings
- Female settings
- Switch character settings