void AddText() { if(CTS_Data == null) return; CTS_Text newText = new CTS_Text(); newText.styleName = "Text Style " + Random.Range(0,1000).ToString(); textList.Add(newText); }
public void UpdateTextFormat() { // thisTextStyle = null; if(useThisTextList.Count == 0 || textList.Count == 0) return; for(int i = 0; i < useThisTextList.Count; i++) { if(useThisTextList[i] && textList[i] != null) { thisTextStyle = textList[i]; useTextindex = i; } } if(thisTextStyle == null) return; text.font = thisTextStyle.font; text.fontSize = thisTextStyle.fontSize; text.fontStyle = thisTextStyle.fontStyle; text.alignment = thisTextStyle.textAnchor; text.verticalOverflow = thisTextStyle.vertWrap; text.horizontalOverflow = thisTextStyle.horzWrap; text.resizeTextForBestFit = thisTextStyle.resizeForBestFit; text.resizeTextMinSize = thisTextStyle.minSize; text.resizeTextMaxSize = thisTextStyle.maxSize; text.color = thisTextStyle.textColor; text.material = thisTextStyle.textMat; text.raycastTarget = thisTextStyle.isRaycastTarget; }