From 40f9937b607be388870375be3abdb0c6e99b6eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=86=A0=E5=B3=B0?= Date: Tue, 11 Feb 2025 09:55:37 +0800 Subject: [PATCH] update space shooter --- .../GameScript/Editor/TextureSchema.cs | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Editor/TextureSchema.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Editor/TextureSchema.cs index 078e993c..54158f5b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Editor/TextureSchema.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Editor/TextureSchema.cs @@ -1,14 +1,12 @@ -using System.Collections; +#if UNITY_2019_4_OR_NEWER +using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEditor; using YooAsset.Editor; - -#if UNITY_2019_4_OR_NEWER using UnityEditor.UIElements; using UnityEngine.UIElements; -#endif [CreateAssetMenu(fileName = "TextureSchema", menuName = "YooAssetArt/Create TextureSchema")] public class TextureSchema : ScannerSchema @@ -37,9 +35,9 @@ public class TextureSchema : ScannerSchema public override ScanReport RunScanner(AssetArtScanner scanner) { // 创建扫描报告 - string title = "扫描所有纹理资产"; + string name = "扫描所有纹理资产"; string desc = GetUserGuide(); - var report = new ScanReport(title, desc); + var report = new ScanReport(name, desc); report.AddHeader("资源路径", 600, 500, 1000).SetStretchable().SetSearchable().SetSortable().SetHeaderType(EHeaderType.AssetPath); report.AddHeader("图片宽度", 100).SetSortable().SetHeaderType(EHeaderType.LongValue); report.AddHeader("图片高度", 100).SetSortable().SetHeaderType(EHeaderType.LongValue); @@ -105,9 +103,9 @@ public class TextureSchema : ScannerSchema // 添加扫描信息 ReportElement result = new ReportElement(assetGUID); result.AddScanInfo("资源路径", assetPath); - result.AddScanInfo("图片宽度", texture.width.ToString()); - result.AddScanInfo("图片高度", texture.height.ToString()); - result.AddScanInfo("内存大小", memorySize.ToString()); + result.AddScanInfo("图片宽度", texture.width); + result.AddScanInfo("图片高度", texture.height); + result.AddScanInfo("内存大小", memorySize); result.AddScanInfo("苹果格式", iosFormat.ToString()); result.AddScanInfo("安卓格式", androidFormat.ToString()); result.AddScanInfo("错误信息", errorInfo); @@ -157,7 +155,6 @@ public class TextureSchema : ScannerSchema /// public override SchemaInspector CreateInspector() { -#if UNITY_2019_4_OR_NEWER var container = new VisualElement(); // 图片最大宽度 @@ -183,8 +180,6 @@ public class TextureSchema : ScannerSchema SchemaInspector inspector = new SchemaInspector(); inspector.Containner = container; return inspector; -#else - return null; -#endif } -} \ No newline at end of file +} +#endif \ No newline at end of file