Ejemplo n.º 1
0
    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();
        }
    }
Ejemplo n.º 2
0
    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));
        }
    }
Ejemplo n.º 3
0
    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();
        }
    }
Ejemplo n.º 4
0
 public virtual void OnConversationStart(OCTree tree)
 {
 }
Ejemplo n.º 5
0
 public OCNode()
 {
     id = OCTree.CreateID();
 }