public void SetToChoice(Choice choice) { //TODO fix this sound E_ActorCategory category = choice.ParentEvent.ConversationActor.ActorCategory; var data = uiTypes.GetDataForCategory(category); EmitterAppear.Play(); if (data == null) { Debug.LogError($"No UI data found for {choice.ParentEvent.ConversationActor.ActorCategory}"); return; } currentChoice = choice; SetVisible(true); choiceText.text = choice.Text; choiceText.font = data.font; //choiceText.UpdateFontAsset(); choiceText.alignment = TextAlignmentOptions.Left; choiceText.font = data.font; var parrentButton = choiceText.GetComponentInParent <Button>(); var parrentImage = choiceText.GetComponentInParent <Image>(); var spriteState = parrentButton.spriteState; spriteState.pressedSprite = data.PressedSprite; spriteState.selectedSprite = data.SelectedSprite; spriteState.highlightedSprite = data.SelectedSprite; parrentButton.spriteState = spriteState; parrentImage.sprite = data.DefaultSprite; }
public Actor(E_ActorCategory actorCategory, E_ActorType actorType, Color tint, string name) { ActorCategory = actorCategory; ActorType = actorType; Tint = tint; Name = name; }
public data GetDataForCategory(E_ActorCategory category) { foreach (var item in UiTypes) { if (item.Target == category) { return(item); } } return(null); }