Set Element By Index


using UnityEngine;
using AdvancedPeopleSystem;

public class DemoScript : MonoBehaviour
{
    public CharacterCustomization character;

    int weight = 0;
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            var lastShirtIndex = character.Settings.shirtsPresets.Count - 1;
            character.SetElementByIndex(CharacterElementType.Shirt, Random.Range(-1, lastShirtIndex)); //Set shirt element by random
        }
    }
}

Press Q to change shirt element

Powered by BetterDocs