Beispiel #1
0
 public void SetWord(string newText, float opacity, TextBlurb textBlurb, int textIndex)
 {
     m_text.text    = newText;
     m_originalText = newText;
     m_textBlurb    = textBlurb;
     m_textIndex    = textIndex;
     this.gameObject.AddComponent <BoxCollider2D>();
     m_text.color = new Color(1.0f, 1.0f, 1.0f, opacity);
 }
    // Update is called once per frame
    void Update()
    {
        if (m_blurb != null)
        {
            TextBlurb[] nextBlurbs = m_blurb.GetNextNodes();
            Rect        pixelRect  = m_blurb.GetComponentInChildren <Canvas> ().pixelRect;
            for (int i = 0; i < nextBlurbs.Length; i++)
            {
                TextBlurb nextBlurb = nextBlurbs [i];

                if (nextBlurb == null)
                {
                    continue;
                }

                nextBlurb.transform.position = m_blurb.transform.position + new Vector3(m_blurb.GetComponentInChildren <Canvas>().pixelRect.width / 10, (i + .5f) * (pixelRect.height / nextBlurbs.Length) / 10 - pixelRect.height / 20, 0);
                nextBlurb.GetComponent <PositionNextEntries> ().Update();
            }
        }
    }
Beispiel #3
0
    public void Enable(TextBlurb parent)
    {
        m_parent = parent;

        StartCoroutine(WaitForKey());
    }