Beispiel #1
0
    void OnTriggerEnter(Collider collider)
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        if (collider.gameObject != player)
        {
            return;
        }

        // TODO: Need to freeze the player


        // Initialize a conversation if one hasn't started yet
        if (!talked)
        {
            talked = true;
            convo  = new GraphConversation(convo_file);
        }

        ConversationDisplayer c = GameObject.Find("ConversationDisplayer").GetComponent(typeof(ConversationDisplayer)) as ConversationDisplayer;

        // TODO: Need to determine if the action was completed

        // Begin the conversation displayer
        c.Converse(convo);
    }
    //INICIAIZATION
    void Start()
    {
        displayerInstance = this;

        access = Name.GetComponent <NameDisplay>();
        //access2 = Sprite.GetComponent<ImageDisplay>();

        _textComponent      = GetComponent <Text>();
        _textComponent.text = ""; //Emptying text display just for good measure.

        ContinueIcon.SetActive(false);
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        Debug.Log(Vector3.Distance(transform.position, player.transform.position));

        if (Vector3.Distance(transform.position, player.transform.position) <= 3 && !talked)
        {
            talked = true;
            ConversationDisplayer c = GameObject.Find("ConversationDisplayer").GetComponent(typeof(ConversationDisplayer)) as ConversationDisplayer;
            c.Initiate(new ExampleConversation());
        }
    }
Beispiel #4
0
    void OnTriggerExit(Collider collider)
    {
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        if (collider.gameObject != player)
        {
            return;
        }

        ConversationDisplayer c = GameObject.Find("ConversationDisplayer").GetComponent(typeof(ConversationDisplayer)) as ConversationDisplayer;

        // Set the conversation to the proper return point
        convo.resetConversation();

        // End the conversation displayer
        c.Converse(null);
    }
Beispiel #5
0
    IEnumerator turnToFaceAndTalk()
    {
        //Does an sudden, jumpy turn which actually looks okayish.  But this method is called as a
        // coroutine in order to facilitate a smoother turn if we want to implement that.

        transform.LookAt(GameObject.FindGameObjectWithTag("Player").transform);

        yield return(new WaitForSeconds(0.2f));

        ConversationDisplayer c = GameObject.Find("ConversationDisplayer").GetComponent(typeof(ConversationDisplayer)) as ConversationDisplayer;

        Time.timeScale = 0;
        if (currentQuest < questList.Length && questList[currentQuest].checkIfCompleted())
        {
            currentQuest++;
        }

        TraceLogger.LogKVtime("conversation", name + ", " + transform.position);

        c.Converse(((Conversation)conversationList[currentQuest]));

        c.show(GameObject.Find("Inventory"));
    }
Beispiel #6
0
 private void Awake()
 {
     instance = this;
     gameObject.SetActive(false);                                              //Asegura que no se muestra el panel primero
     conversationDisplayer = GetComponentInChildren <ConversationDisplayer>(); //Asigna el dialogo
 }