From 2b19134566f6c8046d535f5028a03c23d983191f Mon Sep 17 00:00:00 2001 From: Night Train Code <87555873+MeeXaSiK@users.noreply.github.com> Date: Sat, 10 Feb 2024 22:18:44 +0700 Subject: [PATCH] check for exceptions fix --- Code/GlobalUpdate.cs | 2 +- Code/MonoCache.cs | 2 +- Code/MonoCacheExceptionChecker.cs | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Code/GlobalUpdate.cs b/Code/GlobalUpdate.cs index 8a7b157..bff4729 100644 --- a/Code/GlobalUpdate.cs +++ b/Code/GlobalUpdate.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------------------- // The MIT License // MonoCache is a fast optimization framework for Unity https://github.com/MeeXaSiK/MonoCache -// Copyright (c) 2021-2023 Night Train Code +// Copyright (c) 2021-2024 Night Train Code // ------------------------------------------------------------------------------------------- using System.Collections.Generic; diff --git a/Code/MonoCache.cs b/Code/MonoCache.cs index 4c5f01c..f15cbc2 100644 --- a/Code/MonoCache.cs +++ b/Code/MonoCache.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------------------- // The MIT License // MonoCache is a fast optimization framework for Unity https://github.com/MeeXaSiK/MonoCache -// Copyright (c) 2021-2023 Night Train Code +// Copyright (c) 2021-2024 Night Train Code // ------------------------------------------------------------------------------------------- using System; diff --git a/Code/MonoCacheExceptionChecker.cs b/Code/MonoCacheExceptionChecker.cs index 0df6c4b..1de6c71 100644 --- a/Code/MonoCacheExceptionChecker.cs +++ b/Code/MonoCacheExceptionChecker.cs @@ -1,10 +1,11 @@ // ------------------------------------------------------------------------------------------- // The MIT License // MonoCache is a fast optimization framework for Unity https://github.com/MeeXaSiK/MonoCache -// Copyright (c) 2021-2023 Night Train Code +// Copyright (c) 2021-2024 Night Train Code // ------------------------------------------------------------------------------------------- #if DEBUG +using System; using System.Linq; using System.Reflection; using UnityEngine; @@ -31,16 +32,13 @@ public static void CheckForExceptions() OnEnableMethodName, OnDisableMethodName, UpdateMethodName, FixedUpdateMethodName, LateUpdateMethodName }; var monoCacheType = typeof(MonoCache); - var subclassTypes = Assembly + var derivedTypes = Assembly .GetAssembly(monoCacheType) .GetTypes() - .Where(type => type.IsAssignableFrom(monoCacheType)); + .Where(type => type != monoCacheType && monoCacheType.IsAssignableFrom(type)); - foreach (var type in subclassTypes) + foreach (var type in derivedTypes) { - if (type == monoCacheType) - continue; - var methods = type.GetMethods(MethodFlags); foreach (var targetMethodName in targetMethodNames)