* Added unstrip fix for GetRootSceneObjects using Il2CPP internal call
This commit is contained in:
sinaioutlander
2020-10-09 21:11:15 +11:00
parent 35eb78ca5d
commit 867370ccee
15 changed files with 532 additions and 446 deletions

View File

@ -0,0 +1,41 @@
#if CPP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnhollowerBaseLib;
using UnityEngine;
namespace Explorer.Unstrip.Scene
{
public class SceneUnstrip
{
internal delegate void getRootSceneObjects(int handle, IntPtr list);
internal static getRootSceneObjects getRootSceneObjects_iCall =
IL2CPP.ResolveICall<getRootSceneObjects>("UnityEngine.SceneManagement.Scene::GetRootGameObjectsInternal");
public static void GetRootGameObjects_Internal(UnityEngine.SceneManagement.Scene scene, IntPtr list)
{
getRootSceneObjects_iCall(scene.handle, list);
}
public static GameObject[] GetRootSceneObjects(UnityEngine.SceneManagement.Scene scene)
{
var list = new Il2CppSystem.Collections.Generic.List<GameObject>(GetRootCount_Internal(scene));
GetRootGameObjects_Internal(scene, list.Pointer);
return list.ToArray();
}
internal delegate int getRootCount(int handle);
internal static getRootCount getRootCount_iCall =
IL2CPP.ResolveICall<getRootCount>("UnityEngine.SceneManagement.Scene::GetRootCountInternal");
public static int GetRootCount_Internal(UnityEngine.SceneManagement.Scene scene)
{
return getRootCount_iCall(scene.handle);
}
}
}
#endif