0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:30:46 -05:00

29 lines
634 B
C#
Raw Normal View History

2023-03-03 18:52:31 +00:00
using UnityEngine;
2024-05-21 19:10:17 +01:00
namespace SPT.Reflection.Utils
2023-03-03 18:52:31 +00:00
{
public static class HookObject
{
public static GameObject _object
{
get
{
2024-05-21 19:10:17 +01:00
GameObject result = GameObject.Find("SPT.Hook");
2023-03-03 18:52:31 +00:00
if (result == null)
{
2024-05-21 19:10:17 +01:00
result = new GameObject("SPT.Hook");
2023-03-03 18:52:31 +00:00
Object.DontDestroyOnLoad(result);
}
return result;
}
}
public static T AddOrGetComponent<T>() where T : MonoBehaviour
{
return _object.GetOrAddComponent<T>();
}
}
}