private void ShowUmaCharacter() { if (UmaModel != null) { UmaModel.InitializeUMA(); if (!UmaModel.IsUmaCharacterCreated) { UmaModel.OnUmaCharacterCreated -= OnUmaCharacterCreated; UmaModel.OnUmaCharacterCreated += OnUmaCharacterCreated; return; } dontApplyAvatar = true; if (raceDropdown != null) { raceDropdown.onValueChanged.RemoveListener(OnRaceDropdownValueChanged); raceDropdown.options = new List <DropdownWrapper.OptionData>(); List <DropdownWrapper.OptionData> dropdownOptions = new List <DropdownWrapper.OptionData>(); UmaRace[] races = GameInstance.Singleton.UmaRaces; foreach (UmaRace race in races) { dropdownOptions.Add(new DropdownWrapper.OptionData() { text = race.name, }); } raceDropdown.options = dropdownOptions; OnRaceDropdownValueChanged(0); raceDropdown.onValueChanged.AddListener(OnRaceDropdownValueChanged); } dontApplyAvatar = false; ApplyAvatar(); } }
public void ApplyAvatar() { if (dontApplyAvatar) { return; } UmaModel.ApplyUmaAvatar(GetAvatarData()); }
protected override void OnSelectCharacter(IPlayerCharacterData playerCharacterData) { if (buttonStart) { buttonStart.gameObject.SetActive(true); } if (buttonDelete) { buttonDelete.gameObject.SetActive(true); } characterModelContainer.SetChildrenActive(false); // Load selected character and also set selected player character data PlayerCharacterDataById.TryGetValue(playerCharacterData.Id, out selectedPlayerCharacterData); // Show selected character model CharacterModelById.TryGetValue(playerCharacterData.Id, out selectedModel); if (SelectedModel != null && SelectedModel is ICharacterModelUma) { // Setup Uma model and applies options ICharacterModelUma characterModelUMA = SelectedModel as ICharacterModelUma; UmaModel = characterModelUMA; SelectedModel.gameObject.SetActive(true); UmaModel.ApplyUmaAvatar(SelectedPlayerCharacterData.UmaAvatarData); } }