DragonBones中用字替换龙骨身上的部件

**获取龙骨动画节点,并用字替换**
armatureComponent.armature.GetSlot("zi").display = _GetTextLogo(index);

设置字的相应格式
private GameObject _GetTextLogo(int index)
{
this._replaceText = new GameObject(“txt_logo”);
var textMesh = this._replaceText.AddComponent();
textMesh.characterSize = 0.2f;
textMesh.fontSize = 20;
textMesh.text = StudyData.text[index];
textMesh.GetComponent().color = Color.black;
textMesh.anchor = TextAnchor.MiddleCenter;
textMesh.alignment = TextAlignment.Center;
textMesh.richText = false;
return this._replaceText;
}

你可能感兴趣的:(Unity)