From 71ad34d7acf7eec7a5f1236e37adb30596697d73 Mon Sep 17 00:00:00 2001 From: walon Date: Fri, 22 Dec 2023 21:51:41 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8DAdditional=20Compiler?= =?UTF-8?q?=20Arguments=E4=B8=AD=E8=BE=93=E5=85=A5=20-nullable:enable=20?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8CEditor=E6=8A=9B=E5=87=BAInvalidCastE?= =?UTF-8?q?xception=E7=9A=84bug=E3=80=82=E6=9D=A5=E8=87=AA=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=20https://github.com/focus-creative-games/hybridclr/i?= =?UTF-8?q?ssues/116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Settings/ScriptableSignleton.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Editor/Settings/ScriptableSignleton.cs b/Editor/Settings/ScriptableSignleton.cs index cf2ee1b..903f802 100644 --- a/Editor/Settings/ScriptableSignleton.cs +++ b/Editor/Settings/ScriptableSignleton.cs @@ -59,9 +59,10 @@ namespace HybridCLR.Editor.Settings protected static string GetFilePath() { return typeof(T).GetCustomAttributes(inherit: true) - .Cast() - .FirstOrDefault(v => v != null) - ?.filepath; + .Where(v => v is FilePathAttribute) + .Cast() + .FirstOrDefault() + ?.filepath; } } [AttributeUsage(AttributeTargets.Class)]