Example #1
0
    public override void Interact()
    {
        if (!locked)
        {
            message.SetActive(false);
            GameManager.mainCam.focusOnObject(this.transform);
            myBallon = Instantiate(genericBallon, GameManager.mainCam.canvas.transform);
            if (GameManager.player.canTranslate)
            {
                myBallon.transform.Find("Text").GetComponent <Text>().text = data.normalMessage;
                myBallon.transform.Find("Text").GetComponent <Text>().font = normalFont;

                if (inf != null)
                {
                    inf.sendMessage();
                }
                if (ask != null)
                {
                    ask.activePuzzle();
                }
                if (sol != null)
                {
                    sol.chooseThis();
                }
                if (ul != null)
                {
                    ul.GiveUpgrade();
                }
                if (inq != null)
                {
                    inq.getAnswer();
                }
            }
            else
            {
                myBallon.transform.Find("Text").GetComponent <Text>().text = data.emojiMessage;
                myBallon.transform.Find("Text").GetComponent <Text>().font = emojiFont;
                if (ul != null && this.GetComponent <TranslateUnlocker>() != null)
                {
                    ul.GiveUpgrade();
                }
            }
        }
    }