public void getNextNodeTests()
	{
		GameObject aNode = new GameObject();
		convoNode theConvoNode =  aNode.AddComponent<convoNode>();
		convoNode otherConvoNode =  aNode.AddComponent<convoNode>();

		convoNode[] nextNodeArray = new convoNode[3];
		nextNodeArray [0] = otherConvoNode;
		theConvoNode.nextNodeArray = nextNodeArray;
		Assert.AreEqual (theConvoNode.getNextNode (), otherConvoNode);
		Assert.AreEqual (theConvoNode.getNextNode (0), otherConvoNode);
		Assert.AreNotEqual (theConvoNode.getNextNode (1), otherConvoNode);


	}
Beispiel #2
0
 public void startConvo(convoNode newNode)
 {
     textBox.startConvo(newNode);
 }
Beispiel #3
0
    //In case we seriously need to add ALL THREE.
    public void addQuestion(string answer, eventScript newEvent, convoNode newConvoNode)
    {
        string[] tempAnswer = new string[endAnswerArray.Length + 1];//Make a temp array, since we can't resize arrays.
        for (int i = 0; i < endAnswerArray.Length; i++)
        {
            tempAnswer[i] = endAnswerArray[i];//Add everything in.
        }
        endAnswerArray = tempAnswer;//Set the old to the new.

        if (endAnswerArray.Length != 0)
        {
            endAnswerArray[endAnswerArray.Length - 1] = answer;//Add in our new Answer
        }


        //Repeatthe process for the Event array.
        eventScript[] tempEvent = new eventScript[endEventArray.Length + 1];
        for (int i = 0; i < endEventArray.Length; i++)
        {
            tempEvent[i] = endEventArray[i];
        }

        endEventArray = tempEvent;
        if (endEventArray.Length != 0)
        {
            endEventArray[endEventArray.Length - 1] = newEvent;
        }



        //Repeatthe process for the nextNode array.
        convoNode[] tempConvo = new convoNode[nextNodeArray.Length + 1];
        for (int i = 0; i < nextNodeArray.Length; i++)
        {
            print("triple check number: " + i);
            tempConvo[i] = nextNodeArray[i];
        }

        nextNodeArray = tempConvo;
        if (nextNodeArray.Length != 0)
        {
            nextNodeArray[nextNodeArray.Length - 1] = newConvoNode;
        }

    }
Beispiel #4
0
    public void activate(convoNode q)
    {
        currentNode = q;
        question = currentNode.question;
		deleteText ();
        choiceArray = q.endAnswerArray;
        init();
        enableBox();
        
    }
	public void askQuestion(convoNode q)
	{

        askBoxPartner.activate(q);
        disableBox();
	}
	//Overloaded enable that allows for new conversations to be loaded in.
	public void startConvo(convoNode newNode)
	{
        text.fontStyle = FontStyle.Normal;
        currentNode = newNode;
        if (askBoxPartner.showBox == false)
        {
            if (currentNode.myType == nodeType.question)
            {
                askQuestion(currentNode);

            }
            else
            {

                
                showBox = true;
                convArray = currentNode.convoTextArray;
                reInit();
                enableBox();
            }
        }
	}