2020-10-09 21:11:15 +11:00
|
|
|
|
#if CPP
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2020-10-23 01:48:18 +11:00
|
|
|
|
using Explorer.Helpers;
|
2020-10-09 21:11:15 +11:00
|
|
|
|
using UnhollowerBaseLib;
|
|
|
|
|
using UnityEngine;
|
2020-10-10 20:19:56 +11:00
|
|
|
|
using UnityEngine.SceneManagement;
|
2020-10-09 21:11:15 +11:00
|
|
|
|
|
2020-10-23 01:48:18 +11:00
|
|
|
|
namespace Explorer.Unstrip.Scenes
|
2020-10-09 21:11:15 +11:00
|
|
|
|
{
|
|
|
|
|
public class SceneUnstrip
|
|
|
|
|
{
|
2020-10-10 20:19:56 +11:00
|
|
|
|
//Scene.GetRootGameObjects();
|
2020-10-16 19:40:01 +11:00
|
|
|
|
|
|
|
|
|
internal delegate void d_GetRootGameObjects(int handle, IntPtr list);
|
|
|
|
|
|
2020-10-10 20:19:56 +11:00
|
|
|
|
public static GameObject[] GetRootGameObjects(Scene scene)
|
2020-10-09 21:11:15 +11:00
|
|
|
|
{
|
2020-10-16 19:40:01 +11:00
|
|
|
|
var list = new Il2CppSystem.Collections.Generic.List<GameObject>(GetRootCount(scene));
|
|
|
|
|
|
|
|
|
|
var iCall = ICallHelper.GetICall<d_GetRootGameObjects>("UnityEngine.SceneManagement.Scene::GetRootGameObjectsInternal");
|
2020-10-09 21:11:15 +11:00
|
|
|
|
|
2020-10-16 19:40:01 +11:00
|
|
|
|
iCall.Invoke(scene.handle, list.Pointer);
|
2020-10-09 21:11:15 +11:00
|
|
|
|
|
|
|
|
|
return list.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-10 20:19:56 +11:00
|
|
|
|
//Scene.rootCount;
|
|
|
|
|
|
|
|
|
|
internal delegate int GetRootCountInternal_delegate(int handle);
|
2020-10-16 19:40:01 +11:00
|
|
|
|
|
|
|
|
|
public static int GetRootCount(Scene scene)
|
|
|
|
|
{
|
|
|
|
|
var iCall = ICallHelper.GetICall<GetRootCountInternal_delegate>("UnityEngine.SceneManagement.Scene::GetRootCountInternal");
|
|
|
|
|
return iCall.Invoke(scene.handle);
|
|
|
|
|
}
|
2020-10-09 21:11:15 +11:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|