分离具体属性组件,加入样式表系统

This commit is contained in:
2026-07-25 22:47:14 +08:00
parent b1636d5932
commit 3fbb82f40e
38 changed files with 742 additions and 38 deletions
@@ -14,9 +14,11 @@ namespace XericUI.ReflectionUIGenerator
[Tooltip("用于展示纹理的 RawImage 组件(未设置则自动查找)")]
private RawImage _textureDisplay;
#if dUI_TextMeshPro
[SerializeField]
[Tooltip("纹理名称标签(可选,用于显示纹理资源名)")]
private TMPro.TMP_Text _nameLabel;
#endif
private void Awake()
{
@@ -41,10 +43,12 @@ namespace XericUI.ReflectionUIGenerator
_textureDisplay.texture = tex;
}
#if dUI_TextMeshPro
if (_nameLabel != null)
{
_nameLabel.text = value is Texture t && t != null ? t.name : "None";
}
#endif
};
// 首次同步
@@ -54,10 +58,12 @@ namespace XericUI.ReflectionUIGenerator
_textureDisplay.texture = initTex;
}
#if dUI_TextMeshPro
if (_nameLabel != null)
{
_nameLabel.text = initialValue is Texture t && t != null ? t.name : "None";
}
#endif
}
}
}