Пример #1
0
    // Use this for initialization
    void Start()
    {
        if (!hadInitialConversation)
        {
            GameObject chatBubble = Instantiate(Resources.Load("Prefabs/ChatBubble")) as GameObject;

            ChatBubbleController chatController = chatBubble.GetComponent <ChatBubbleController>();
            chatController.SetChatContent(initialConversation, this);
            isChatting             = true;
            hadInitialConversation = true;
        }

        player = GameObject.Find("Player");
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        ChatBubble = GetComponent<ChatBubbleController> ();
        /*
        if (CurrentText < TextArray.Length)
        {
            CurrentText += 1;
            //StartCoroutine (AnimateText ()); Oh it's trying to get James Typer before it exists
            jamesType = ChatController.JamesBubble.gameObject.GetComponent<JamesTyper>();
            print ("got JamesTyper");
            //jamesType.WriteText ();

        }
        */
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        if (!isChatting)
        {
            if (Vector2.Distance(player.transform.position, gameObject.transform.position) <= 1)
            {
                if (Input.GetKeyDown(KeyCode.E))
                {
                    isChatting = true;
                    GameObject chatBubble = GameObject.Instantiate(Resources.Load("Prefabs/ChatBubble")) as GameObject;

                    ChatBubbleController chatController = chatBubble.GetComponent <ChatBubbleController> ();
                    chatController.SetChatContent(GetResponseForState(), this);
                }
            }
        }
    }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     Textbox = GetComponent<Text>();
     ChatController = Chatbox.GetComponent<ChatBubbleController>();
 }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     ChatController = Chatbox.GetComponent<ChatBubbleController>();
 }