Пример #1
0
	public void init()
	{
        player = (playerChar)GameObject.FindObjectOfType(typeof(playerChar));//DYNAMICALLY GET OUR CHARACTER ON INIT!
        sceneEventTracker = (eventTracker)GameObject.FindObjectOfType(typeof(eventTracker));//Dynamically get our eventTracker on INIT.
        if(currentNode != null)
        {
            if (currentNode.myType != nodeType.textOnly)
            {
                progressIndex = 0;
                choiceID = 0;
                text.text = "";
                qText.text = currentNode.question;
                choiceArray = currentNode.endAnswerArray;
                tinyTimer = resetTimer;
                textSpeed = resetTextSpeed;
                charArray = new char[choiceArray[progressIndex].Length];//We get the length of the string in our current conversationPoint.
                isFinishedDisplaying = false;
                //prepStrings();
                horiIndex = 0;
                vertIndex = 0;

                deleteText();
                createTextObjects();
            }
        }
    }
Пример #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         player = other.gameObject.GetComponent<playerChar>();
         player.touchedPerson = this;
         player.isTouchingPerson = true;
     }
 }
Пример #3
0
	void OnTriggerExit2D(Collider2D other)
	{
		if (other.gameObject.CompareTag("Player"))
		{ print("EXIT"); 

		player = other.gameObject.GetComponent<playerChar>();
		//player.touchedDoor = null;
		player.isTouchingDoor = false;
			player = null;
        }

    }
Пример #4
0
    void OnTriggerExit2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            if (player != null)
            {
                //player.touchedPerson = null;
                player.isTouchingPerson = false;
                player = null;
            }

        }

        


    }
Пример #5
0
	// Use this for initialization
	void Start () {
        player = (playerChar)GameObject.FindObjectOfType(typeof(playerChar));//DYNAMICALLY GET OUR CHARACTER ON INIT!
        init();
	}
Пример #6
0
    //The initialization function for when our program has started running.
    public void init()
    {
        player = (playerChar)GameObject.FindObjectOfType(typeof(playerChar));//DYNAMICALLY GET OUR CHARACTER ON INIT!
        sceneEventTracker = (eventTracker)GameObject.FindObjectOfType(typeof(eventTracker));//Dynamically get our eventTracker on INIT.
        //We set these next two so that the timers will know what number to reset to.
        resetTimer = tinyTimer;
        resetTextSpeed = textSpeed;
        isFinishedDisplaying = false;
        conversationPoint = 0;//So that we start at the BEGINNING of the convo

        if (currentNode !=null)
        {
            if (currentNode.myType != nodeType.question) {//Make sure to check whether or not we should even be bothering to set up.
                convArray = currentNode.convoTextArray;//Load up our text to sidplay from our node.
                text.text = "";//Make sure our text is empty before we start.
                charArray = new char[convArray[conversationPoint].Length];//We get the length of the string in our current conversationPoint.
                resetNPCFace();  
                
                prepStrings();
            }
            else//If it's just a question, immediately activate our Ask Box buddy.
            {
                disableBox();
                askQuestion(currentNode);
            }
        }
	}