Files
UnityExplorer_Fix/src/Unstrip/ResourcesUnstrip.cs

30 lines
751 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;
2020-11-23 18:23:25 +11:00
using UnhollowerRuntimeLib;
2020-11-09 16:43:19 +11:00
#endif
namespace UnityExplorer.Unstrip
{
public class ResourcesUnstrip
{
2020-11-23 18:23:25 +11:00
public static UnityEngine.Object[] FindObjectsOfTypeAll(Type type)
2020-11-09 16:43:19 +11:00
{
2020-11-23 18:23:25 +11:00
#if MONO
return UnityEngine.Resources.FindObjectsOfTypeAll(type);
#else
2020-11-09 16:43:19 +11:00
var iCall = ICallHelper.GetICall<d_FindObjectsOfTypeAll>("UnityEngine.Resources::FindObjectsOfTypeAll");
2020-11-23 18:23:25 +11:00
var cppType = Il2CppType.From(type);
2020-11-09 16:43:19 +11:00
2020-11-23 18:23:25 +11:00
return new Il2CppReferenceArray<UnityEngine.Object>(iCall.Invoke(cppType.Pointer));
2020-11-09 16:43:19 +11:00
#endif
2020-11-23 18:23:25 +11:00
}
2020-11-09 16:43:19 +11:00
2020-11-23 18:23:25 +11:00
#if CPP
internal delegate IntPtr d_FindObjectsOfTypeAll(IntPtr type);
#endif
2020-11-09 16:43:19 +11:00
}
}