public void ChoiceSelected(string id) { DialogueSystemCallbackDelegate callbackDelegate = null; ConversationChoice conversationChoice = null; if (this.choices.ContainsKey(id)) { conversationChoice = this.choices[id]; if (!String.IsNullOrEmpty(conversationChoice.NavigateTo)) { // All selected is overriden by NavigateTo this.ParentConversation.ExecuteNode(conversationChoice.NavigateTo); } else { if (!String.IsNullOrEmpty(conversationChoice.OnSelectedID)) { callbackDelegate = this.ParentConversation.ParentConversationManager.GetMethodDelegate(conversationChoice.OnSelectedID) as DialogueSystemCallbackDelegate; } else { if (!String.IsNullOrEmpty(this.ParentConversation.DefaultOnSelectedID)) { callbackDelegate = this.ParentConversation.ParentConversationManager.GetMethodDelegate(this.ParentConversation.DefaultOnSelectedID) as DialogueSystemCallbackDelegate; } } } } callbackDelegate?.Invoke(this.ParentConversation.ParentConversationManager, id); }
internal void AddChoice(ConversationChoice conversationChoice) { this.choices.Add(conversationChoice.ID, conversationChoice); }