Files
UnityExplorer_Fix/src/Unstrip/ResourcesUnstrip.cs

27 lines
728 B
C#
Raw Normal View History

2020-11-09 16:43:19 +11:00
using System;
using Mono.CSharp;
using UnityExplorer.Helpers;
#if CPP
using UnhollowerBaseLib;
#endif
namespace UnityExplorer.Unstrip
{
public class ResourcesUnstrip
{
#if CPP
internal delegate IntPtr d_FindObjectsOfTypeAll(IntPtr type);
public static UnityEngine.Object[] FindObjectsOfTypeAll(Il2CppSystem.Type type)
{
var iCall = ICallHelper.GetICall<d_FindObjectsOfTypeAll>("UnityEngine.Resources::FindObjectsOfTypeAll");
return new Il2CppReferenceArray<UnityEngine.Object>(iCall.Invoke(type.Pointer));
}
#else
public static UnityEngine.Object[] FindObjectsOfTypeAll(Type type) => UnityEngine.Resources.FindObjectsOfTypeAll(type);
#endif
}
}