Пример #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);
        }
Пример #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);
        }
Пример #3
0
 void Awake()
 {
     textTemplate = GetComponentInChildren <TableRowText>();
 }