public void LoadConversationFile(ConversationJSON convo) { m_currentConversation = convo; if (m_currentConversation != null) { Debug.Log("Loaded Conversation: " + m_currentConversation.conversationId); } }
public void LoadConversationById(string convoId) { m_currentConversation = ConversationManager.instance.GetConversationById(convoId); if (m_currentConversation != null) { Debug.Log("Loaded Conversation: " + m_currentConversation.conversationId); } }
public static ConversationJSON CreateFromJSON(string conversationStr) { // Debug.Log("Convo Str: " + conversationStr); JSONNode node = JSON.Parse(conversationStr); ConversationJSON conversationJSON = JsonUtility.FromJson <ConversationJSON>(node.ToString()); conversationJSON.conversationTree = ConversationTreeJSON.CreateFromJSON(node["conversationTree"].ToString()); return(conversationJSON); }
public void LoadConversationResources() { conversationFilesById = new Dictionary <string, ConversationJSON>(); TextAsset[] conversationFileAssets = Resources.LoadAll <TextAsset>(conversationFilePath); // Debug.Log("Number of Conversation Assets: " + conversationFileAssets.Length); foreach (TextAsset conversationAsset in conversationFileAssets) { // Debug.Log("Conversation text asset: " + conversationAsset.text); ConversationJSON conversation = ConversationJSON.CreateFromJSON(conversationAsset.text); if (conversation != null) { // Debug.Log("Conversation: " + conversation.GetFieldValues()); conversationFilesById.Add(conversation.conversationId, conversation); } } Debug.Log("Loaded: " + conversationFilesById.Keys.Count + " Conversations"); }