コード例 #1
0
    public void Update()
    {
        if (Input.GetMouseButtonUp(0))
        {
            if (selected)
            {
                Debug.Log(selected.title + " was selected!");   //para saber si detecta la opción//

                myAgent = GameObject.FindGameObjectWithTag("Prota").GetComponent <AgentScript>();

                Debug.Log(myAgent);
                myAgent.MoverPersonaje();



                if (selected.title == "talk")
                {
                    Debug.Log(selected.title + " VAMOS PROGRESANDO COÑO!");  //para saber si detecta la opción//


                    // VIDE_Assign assigned;
                    // assigned = GameObject.Find("ElaineMenu").AddComponent<VIDE_Assign>();
                    //   Debug.Log("ASSIGNED: " + assigned);
                    // diagUI.Begin(assigned);
                    //   GameObject x = GameObject.Find("NPC_Charlie");
                    //   dialogue2 = x.AddComponent<VIDE_Data>();
                    //   Debug.Log("DIALOGUE: " + assigned);
                    //myAgent.TryInteract(assigned);
                    // dialogue.BeginDialogue(GetComponent<VIDE_Assign>());
                    //    Debug.Log("ASSIGNED2: " + assigned);
                    //myAgent.OnGUI(dialogue);
                    myAgent.TryInteract(/*dialogue.GetComponent<VIDE_Assign>()*/);

                    /*  assigned = GameObject.Find("NPC_Charlie").GetComponent<VIDE_Assign>();
                     *
                     * if (!diagUI.dialogue.isLoaded)
                     * {
                     *
                     *    //... and use it to begin the conversation
                     *    diagUI.Begin(assigned);
                     *    while (diagUI.dialogue.isLoaded)
                     *    {
                     *
                     *
                     *        if (Input.GetMouseButtonDown(0))
                     *    {
                     *
                     *        diagUI.NextNode();
                     *
                     *    }
                     *    }
                     * }
                     * else
                     * {
                     *    //If conversation already began, let's just progress through it
                     *    diagUI.NextNode();
                     * }*/
                }
            }


            Destroy(gameObject);
        }
    }