Exemplo n.º 1
0
 public void Addnew()
 {
     if (addheading)
     {
         TextMeshProUGUI proheading = TextMeshProUGUI.Instantiate(format, this.transform, false);
         proheading.text = "Pros";
         addheading      = false;
     }
     for (int i = 0; i < pros.Length; i++)
     {
         TextMeshProUGUI pro1 = TextMeshProUGUI.Instantiate(format, this.transform, false);
         pro1.text = pros[i];
     }
 }
Exemplo n.º 2
0
        /**
         * <summary>   Default constructor. </summary>
         *
         * <param name="text">     (Optional) The text. </param>
         * <param name="prefab">   (Optional) The prefab. </param>
         **/

        public MLabel(string text = "", TextMeshProUGUI prefab = null)
        {
            if (prefab == null)
            {
                TextMesh = TextMeshProUGUI.Instantiate(GameAccess.Prefabs.Label1);
            }
            else
            {
                TextMesh = TextMeshProUGUI.Instantiate(prefab);
            }
            gameobject      = TextMesh.gameObject;
            Text            = text;
            gameobject.name = "MLabel";
            RectTransform   = gameobject.GetComponentInChildren <RectTransform>();
        }
Exemplo n.º 3
0
    void showMsg(Player _User, string _Chat)
    {
        TextMeshProUGUI newText = TextMeshProUGUI.Instantiate(chatText, chatContent.transform);

        newText.text = _User.getName() + " : " + _Chat;
        if (chatQueue.Count == 10)
        {
            Destroy(chatQueue.Dequeue().gameObject);
        }
        chatQueue.Enqueue(newText);
        _User.setSpeechBubble(_Chat);

        if (!chatScroll)
        {
            setScrollBar();
        }
        chatScroll.value = 0;
    }