UnityExplorer/src/ExplorerBehaviour.cs

38 lines
831 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
#if CPP
using UnhollowerRuntimeLib;
#endif
namespace UnityExplorer
{
public class ExplorerBehaviour : MonoBehaviour
{
internal static ExplorerBehaviour Instance { get; private set; }
2022-04-09 18:58:56 +10:00
#if CPP
public ExplorerBehaviour(IntPtr ptr) : base(ptr) { }
#endif
internal static void Setup()
{
#if CPP
ClassInjector.RegisterTypeInIl2Cpp<ExplorerBehaviour>();
#endif
2022-04-09 18:58:56 +10:00
GameObject obj = new("ExplorerBehaviour");
DontDestroyOnLoad(obj);
obj.hideFlags = HideFlags.HideAndDontSave;
Instance = obj.AddComponent<ExplorerBehaviour>();
}
internal void Update()
{
ExplorerCore.Update();
}
}
}