Skip to content

Commit

Permalink
check for exceptions fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MeeXaSiK committed Feb 10, 2024
1 parent c758d36 commit 2b19134
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Code/GlobalUpdate.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Code/MonoCache.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
12 changes: 5 additions & 7 deletions Code/MonoCacheExceptionChecker.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 2b19134

Please sign in to comment.