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)!
        }
    }
}
  1. Get Settings
  2. Male settings
  3. Female settings
  4. Switch character settings