Exemple #1
0
        public static TableRowText Instantiate(GameObject original, Transform parent, string text, bool isHeader = false)
        {
            GameObject   go       = GameObject.Instantiate(original, parent);
            TableRowText instance = go.GetComponent <TableRowText>();

            instance.text.text      = text;
            instance.text.fontStyle = isHeader ? FontStyle.Bold : FontStyle.Normal;

            return(instance);
        }
Exemple #2
0
        void InstantiateTexts(List <string> data, bool isHeader = false)
        {
            foreach (string text in data)
            {
                TableRowText.Instantiate(textTemplate.gameObject, transform, text, isHeader);
            }

            // Delete template
            Destroy(textTemplate.gameObject);
        }
Exemple #3
0
 void Awake()
 {
     textTemplate = GetComponentInChildren <TableRowText>();
 }