Feat: 场景视图mod,UI框架更换标题

This commit is contained in:
m0_75251201
2025-11-08 14:03:17 +08:00
parent 786025f720
commit 9b91218973
114 changed files with 2654 additions and 177 deletions

View File

@@ -14,21 +14,16 @@ namespace UIFrame
public Dictionary<string, Canvas> canvasDic = new Dictionary<string, Canvas>();
private void Awake()
{
gameOriginMainMenuUI.Initialize();
}
private void OnDestroy()
{
gameOriginMainMenuUI.Cleanup();
}
public override bool CreateCanvas(string name)
{
return false;
}
// private void Awake()
// {
// gameOriginMainMenuUI.Initialize();
// }
//
// private void OnDestroy()
// {
// gameOriginMainMenuUI.Cleanup();
// }
public override bool SetTitleImage(Sprite sprite)
{
@@ -36,26 +31,26 @@ namespace UIFrame
}
public override TMP_FontAsset CreateFontAsset(string fontFilePath)
{
var font = Font.CreateDynamicFontFromOSFont(fontFilePath, 24);
var tmpFont = TMP_FontAsset.CreateFontAsset(
font,
samplingPointSize: 72, // 采样点大小,影响字体质量
atlasPadding: 4, // 图集内字符间距
renderMode: GlyphRenderMode.SDFAA, // 推荐使用 SDF 抗锯齿模式
atlasWidth: 1024, // 图集宽度 (2的幂)
atlasHeight: 1024, // 图集高度 (2的幂)
atlasPopulationMode: AtlasPopulationMode.Dynamic, // 动态填充
enableMultiAtlasSupport: true // 启用多图集支持
);
return tmpFont;
}
// public override TMP_FontAsset CreateFontAsset(string fontFilePath)
// {
// var font = Font.CreateDynamicFontFromOSFont(fontFilePath, 24);
// var tmpFont = TMP_FontAsset.CreateFontAsset(
// font,
// samplingPointSize: 72, // 采样点大小,影响字体质量
// atlasPadding: 4, // 图集内字符间距
// renderMode: GlyphRenderMode.SDFAA, // 推荐使用 SDF 抗锯齿模式
// atlasWidth: 1024, // 图集宽度 (2的幂)
// atlasHeight: 1024, // 图集高度 (2的幂)
// atlasPopulationMode: AtlasPopulationMode.Dynamic, // 动态填充
// enableMultiAtlasSupport: true // 启用多图集支持
// );
// return tmpFont;
// }
public override bool SetFont(TMP_FontAsset font)
{
return gameOriginMainMenuUI.SetFont(font);
}
// public override bool SetFont(TMP_FontAsset font)
// {
// return gameOriginMainMenuUI.SetFont(font);
// }
public override Texture2D? LoadTexture(string imageFilePath)
{