2021-03-16 18:12:39 +11:00
|
|
|
|
using System;
|
2021-03-25 18:39:35 +11:00
|
|
|
|
using System.Collections;
|
2021-03-16 18:12:39 +11:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2021-03-18 17:17:29 +11:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
2021-03-30 19:50:04 +11:00
|
|
|
|
using UnityEngine.UI;
|
2021-03-16 18:12:39 +11:00
|
|
|
|
|
2021-03-18 17:17:29 +11:00
|
|
|
|
namespace UnityExplorer.Core.Runtime
|
2021-03-16 18:12:39 +11:00
|
|
|
|
{
|
|
|
|
|
// Work in progress, this will be used to replace all the "if CPP / if MONO"
|
|
|
|
|
// pre-processor directives all over the codebase.
|
|
|
|
|
|
|
|
|
|
public abstract class RuntimeProvider
|
|
|
|
|
{
|
|
|
|
|
public static RuntimeProvider Instance;
|
|
|
|
|
|
2021-03-18 17:17:29 +11:00
|
|
|
|
public ReflectionProvider Reflection;
|
|
|
|
|
public TextureUtilProvider TextureUtil;
|
|
|
|
|
|
2021-03-16 18:12:39 +11:00
|
|
|
|
public RuntimeProvider()
|
|
|
|
|
{
|
|
|
|
|
Initialize();
|
|
|
|
|
|
|
|
|
|
SetupEvents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Init() =>
|
|
|
|
|
#if CPP
|
|
|
|
|
Instance = new Il2Cpp.Il2CppProvider();
|
|
|
|
|
#else
|
|
|
|
|
Instance = new Mono.MonoProvider();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public abstract void Initialize();
|
|
|
|
|
|
|
|
|
|
public abstract void SetupEvents();
|
|
|
|
|
|
2021-03-25 18:39:35 +11:00
|
|
|
|
public abstract void StartConsoleCoroutine(IEnumerator routine);
|
|
|
|
|
|
2021-03-18 17:17:29 +11:00
|
|
|
|
// Unity API handlers
|
|
|
|
|
|
|
|
|
|
public abstract string LayerToName(int layer);
|
|
|
|
|
|
|
|
|
|
public abstract UnityEngine.Object[] FindObjectsOfTypeAll(Type type);
|
|
|
|
|
|
|
|
|
|
public abstract int GetSceneHandle(Scene scene);
|
|
|
|
|
|
|
|
|
|
public abstract GameObject[] GetRootGameObjects(Scene scene);
|
|
|
|
|
|
|
|
|
|
public abstract int GetRootCount(Scene scene);
|
2021-03-30 19:50:04 +11:00
|
|
|
|
|
|
|
|
|
public abstract void CheckInputPointerEvent();
|
2021-03-16 18:12:39 +11:00
|
|
|
|
}
|
|
|
|
|
}
|