public void Randomize(DynamicCharacterAvatar Avatar) { // Must clear that out! Avatar.WardrobeRecipes.Clear(); UMARandomizer Randomizer = null; if (Randomizers != null) { if (Randomizers.Count == 0) { return; } if (Randomizers.Count == 1) { Randomizer = Randomizers[0]; } else { Randomizer = Randomizers[UnityEngine.Random.Range(0, Randomizers.Count)]; } } if (Avatar != null && Randomizer != null) { RandomAvatar ra = Randomizer.GetRandomAvatar(); Avatar.ChangeRaceData(ra.RaceName); //Avatar.BuildCharacterEnabled = true; var RandomDNA = ra.GetRandomDNA(); Avatar.predefinedDNA = RandomDNA; var RandomSlots = ra.GetRandomSlots(); if (ra.SharedColors != null && ra.SharedColors.Count > 0) { foreach (RandomColors rc in ra.SharedColors) { if (rc.ColorTable != null) { Avatar.SetColor(rc.ColorName, GetRandomColor(rc), false); } } } foreach (string s in RandomSlots.Keys) { List <RandomWardrobeSlot> RandomWardrobe = RandomSlots[s]; RandomWardrobeSlot uwr = GetRandomWardrobe(RandomWardrobe); if (uwr.WardrobeSlot != null) { AddRandomSlot(Avatar, uwr); } } } }