Files
H3VR-TNH-Quality-of-Life-Im…/Assets/_Scripts/InPlay.cs
T

39 lines
873 B
C#
Raw Normal View History

using HarmonyLib;
using System.Reflection;
2022-01-22 20:13:49 -08:00
using UnityEngine;
using FistVR;
namespace TNHQoLImprovements
{
/// <summary>
/// Code here should only be run when in TNH play.
/// </summary>
public class InPlay : MonoBehaviour
{
public static TNH_Manager tnhManager;
2022-01-30 03:16:24 -08:00
public static bool InHold()
{
if (tnhManager == null)
return false;
return tnhManager.Phase == TNH_Phase.Hold;
}
2022-01-22 20:13:49 -08:00
void Start()
{
2022-06-06 19:09:31 -07:00
tnhManager = FindObjectOfType<TNH_Manager>();
2022-01-22 20:13:49 -08:00
TNHInfo.instance = Instantiate<GameObject>(MeatKitPlugin.bundle.LoadAsset<GameObject>("TNHInfo"),
FindObjectOfType<TAH_Reticle>().transform.GetChild(3))
.GetComponent<TNHInfo>();
TNHInfo.instance.transform.localScale = new Vector3(0.002f, 0.002f, 0.002f);
}
void OnDestroy()
{
// Destroy statics
tnhManager = null;
2022-01-22 20:13:49 -08:00
}
}
}