feat:场景视图添加属性编辑,添加轮廓显示

This commit is contained in:
m0_75251201
2025-11-13 16:24:49 +08:00
parent 9b91218973
commit 8fcbdc5649
95 changed files with 2836 additions and 445 deletions

View File

@@ -10,8 +10,8 @@ namespace SceneView
private static readonly Dictionary<string, TMP_FontAsset> _fontCache = new Dictionary<string, TMP_FontAsset>();
/// <summary>
/// 根据字体名称从操作系统加载字体,并创建 TMP_FontAsset带缓存
/// 非常遗憾,用不了
/// 根据字体名称从操作系统加载字体,并创建 TMP_FontAsset带缓存
/// 非常遗憾,用不了
/// </summary>
/// <param name="fontName">系统字体名称,如 "Arial", "Microsoft YaHei" 等</param>
/// <returns>对应的 TMP_FontAsset失败则返回 null</returns>
@@ -22,7 +22,7 @@ namespace SceneView
if (_fontCache.TryGetValue(fontName, out var cached))
return cached;
var baseFont = Font.CreateDynamicFontFromOSFont(fontName, 12); // 12 是临时大小,不影响 TMP 字体质量
if (baseFont == null || baseFont.dynamic == false)
@@ -34,13 +34,13 @@ namespace SceneView
// 创建 TMP 字体资源
var tmpFont = TMP_FontAsset.CreateFontAsset(
baseFont,
samplingPointSize: 72,
atlasPadding: 4,
renderMode: GlyphRenderMode.SDFAA,
atlasWidth: 1024,
atlasHeight: 1024,
atlasPopulationMode: AtlasPopulationMode.Dynamic,
enableMultiAtlasSupport: true
72,
4,
GlyphRenderMode.SDFAA,
1024,
1024,
AtlasPopulationMode.Dynamic,
true
);
if (tmpFont != null)
@@ -57,7 +57,7 @@ namespace SceneView
}
/// <summary>
/// 清空缓存(谨慎使用,通常不需要)
/// 清空缓存(谨慎使用,通常不需要)
/// </summary>
public static void ClearCache()
{