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

44 lines
1.2 KiB
C#
Raw Normal View History

2022-01-22 20:13:49 -08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using FistVR;
namespace TNHQoLImprovements
{
public class HoldCounter : MonoBehaviour
{
2022-01-22 23:41:31 -08:00
private void OnDeath(bool _)
{
Debug.Log("I died!");
2022-01-24 03:40:08 -08:00
}
// TODO: lose counter. patch postfix FistVR.TNH_Manager.HoldPointCompleted
private void OnHoldLose()
{
2022-01-22 23:41:31 -08:00
}
2022-01-22 20:13:49 -08:00
void Start()
{
2022-01-24 03:40:08 -08:00
//transform.parent = GameObject.Find("_NewTAHReticle/TAHReticle_HealthBar").transform;
transform.parent = FindObjectOfType<TAH_Reticle>().transform.GetChild(3);
2022-01-22 20:13:49 -08:00
transform.localPosition = new Vector3(-1f, 0, -.5f);
transform.localRotation = Quaternion.Euler(90, 0, 0);
transform.localScale = new Vector3(0.002f, 0.002f, 0.002f);
2022-01-22 23:41:31 -08:00
2022-01-24 03:40:08 -08:00
FindObjectOfType<FVRSceneSettings>().PlayerDeathEvent += OnDeath;
2022-01-22 20:13:49 -08:00
}
void Update()
{
string display = "";
if (InPlay.tnhManager.ProgressionMode == TNHSetting_ProgressionType.Marathon)
2022-01-22 23:41:31 -08:00
display = InPlay.tnhManager.m_level.ToString() + " / ∞";
2022-01-22 20:13:49 -08:00
else
display = string.Format("{0} / {1}", InPlay.tnhManager.m_level, InPlay.tnhManager.m_maxLevels);
transform.GetChild(1).GetComponent<Text>().text = display;
}
}
}