public void ChangeRace(int raceId) { var RaceToSet = raceDropdownOptions[raceId]; if (RaceToSet != Avatar.activeRace.name) { CloseAllPanels(); thisRace = RaceToSet; //Force CharacterSystem to find the new race - unless its None Set if (RaceToSet != "None Set") { UMAContext.Instance.raceLibrary.GetRace(RaceToSet); } DynamicCharacterAvatar.ChangeRaceOptions thisLoadOptions = DynamicCharacterAvatar.ChangeRaceOptions.none; if (_keepDNA || _keepWardrobe || _keepBodyColors) { if (_keepDNA) { thisLoadOptions |= DynamicCharacterAvatar.ChangeRaceOptions.keepDNA; } if (_keepWardrobe) { thisLoadOptions |= DynamicCharacterAvatar.ChangeRaceOptions.keepWardrobe; } if (_keepBodyColors) { thisLoadOptions |= DynamicCharacterAvatar.ChangeRaceOptions.keepBodyColors; } thisLoadOptions &= ~DynamicCharacterAvatar.ChangeRaceOptions.none; } Avatar.ChangeRace(RaceToSet, thisLoadOptions); } }
public void ChangeRace(string racename) { if (Avatar == null) { return; } CloseAllPanels(); int raceInt = -1; for (int i = 0; i < changeRaceDropdown.options.Count; i++) { if (changeRaceDropdown.options[i].text == racename) { raceInt = i; break; } } if (raceInt != -1) { ChangeRace(raceInt); } else { //this must be a newly Downloaded Race so just let CharacterAvatar deal with it... DynamicCharacterAvatar.ChangeRaceOptions thisLoadOptions = DynamicCharacterAvatar.ChangeRaceOptions.none; if (_keepDNA || _keepWardrobe || _keepBodyColors) { if (_keepDNA) { thisLoadOptions |= DynamicCharacterAvatar.ChangeRaceOptions.keepDNA; } if (_keepWardrobe) { thisLoadOptions |= DynamicCharacterAvatar.ChangeRaceOptions.keepWardrobe; } if (_keepBodyColors) { thisLoadOptions |= DynamicCharacterAvatar.ChangeRaceOptions.keepBodyColors; } thisLoadOptions &= ~DynamicCharacterAvatar.ChangeRaceOptions.none; } Avatar.ChangeRace(racename, thisLoadOptions); } }