mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:30:46 -05:00
29 lines
634 B
C#
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>();
|
|
}
|
|
}
|
|
}
|