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>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|