0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 05:50:44 -05:00
2024-05-21 19:10:17 +01:00

29 lines
634 B
C#

using UnityEngine;
namespace SPT.Reflection.Utils
{
public static class HookObject
{
public static GameObject _object
{
get
{
GameObject result = GameObject.Find("SPT.Hook");
if (result == null)
{
result = new GameObject("SPT.Hook");
Object.DontDestroyOnLoad(result);
}
return result;
}
}
public static T AddOrGetComponent<T>() where T : MonoBehaviour
{
return _object.GetOrAddComponent<T>();
}
}
}