Switch Character Settings
Example
using UnityEngine;
using AdvancedPeopleSystem;
public class DemoScript : MonoBehaviour
{
public CharacterCustomization character;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Q))
{
var selectors = character.GetCharacterSettingsSelectors(); //Get Settings
CharacterSettingsSelector maleSettings = selectors.Find(f => f.name == "Male"); //Male settings
CharacterSettingsSelector femaleSettings = selectors.Find(f => f.name == "Female"); //Female settings
if (maleSettings != null && femaleSettings != null)
character.SwitchCharacterSettings( (character.Settings == maleSettings.settings) ? femaleSettings.name : maleSettings.name); //Switch character settings
}
}
}
- Press Q to change character settings