This commit is contained in:
Gurge44 committed 2026-07-21 18:36:29 +02:00
1 parent 0d9e4d11c7
commit 59be8d587e
24 files changed
+300 -311

No files matched your search

-27
View File
@@ -2,39 +2,12 @@ using System;
using System.Linq.Expressions;
using System.Reflection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSystem.Collections.Generic;
using UnityEngine;
namespace EHR;
public static class ObjectHelper
{
private static readonly List<Behaviour> BehaviourCache = new(16);
public static void Destroy(GameObject go)
{
if (!go || go.Pointer == IntPtr.Zero) return;
BehaviourCache.Clear();
go.GetComponents(BehaviourCache);
for (int i = 0; i < BehaviourCache.Count; i++)
{
try
{
Behaviour behaviour = BehaviourCache[i];
if (behaviour && behaviour.Pointer != IntPtr.Zero)
Object.Destroy(behaviour);
}
catch { }
}
BehaviourCache.Clear();
Object.Destroy(go);
}
public static void DestroyTranslator(this GameObject obj)
{
if (!obj) return;