public void StartConversation(OCTree tree) { if (!this.tree && tree && tree.rootNodes.Length > 0) { this.tree = tree; currentNode = tree.rootNodes[tree.currentRoot].firstNode; eventHandler.OnConversationStart(tree); DisplayNode(); } }
override public void OnInspectorGUI() { OCTree tree = (OCTree)target; List <string> roots = new List <string> (); for (int i = 0; i < tree.rootNodes.Length; i++) { roots.Add(i.ToString()); } tree.currentRoot = EditorGUILayout.Popup("Current root", tree.currentRoot, roots.ToArray()); if (GUILayout.Button("Open editor", GUILayout.Height(32))) { OCTreeEditor.target = tree; EditorWindow.GetWindow(typeof(OCTreeEditor)); } }
public void EndConversation(bool stopAudio) { if (stopAudio && currentAudioSource) { currentAudioSource.Stop(); } foreach (OCSpeaker s in speakers) { if (s.gameObject) { s.gameObject.SendMessage("OnConversationEnd", SendMessageOptions.DontRequireReceiver); } } tree = null; currentAudioSource = null; if (eventHandler) { eventHandler.OnConversationEnd(); } }
public virtual void OnConversationStart(OCTree tree) { }
public OCNode() { id = OCTree.CreateID(); }