mirror of
https://github.com/muskit/H3VR-TNH-Quality-of-Life-Improvements.git
synced 2026-06-02 20:24:26 -07:00
win/lose hold stats, hp crystal expiration
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UIRingTimer : MonoBehaviour {
|
||||
|
||||
private bool initialized = false;
|
||||
private float endTime;
|
||||
private float length;
|
||||
|
||||
private Image ringImg;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
ringImg = GetComponentInChildren<Image>();
|
||||
}
|
||||
|
||||
public void Init(float timeInSeconds)
|
||||
{
|
||||
length = timeInSeconds;
|
||||
endTime = Time.time + length;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
void Update () {
|
||||
if (!initialized)
|
||||
return;
|
||||
|
||||
float amount = (endTime - Time.time) / length;
|
||||
ringImg.fillAmount = Mathf.Clamp01(amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user