// 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"); }
// 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 (); } */ }
// 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); } } } }
// Use this for initialization void Start() { Textbox = GetComponent<Text>(); ChatController = Chatbox.GetComponent<ChatBubbleController>(); }
// Use this for initialization void Start() { ChatController = Chatbox.GetComponent<ChatBubbleController>(); }