This commit is contained in:
Gerard Gascón 2025-04-24 17:19:36 +02:00
commit 001bb14f16
951 changed files with 270074 additions and 0 deletions

View file

@ -0,0 +1,43 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LightBar : MonoBehaviour{
public float maxTime;
[HideInInspector]
public float time;
public Animator anim;
float timeRest = 1;
bool brujula;
// Start is called before the first frame update
void Start(){
time = maxTime;
}
// Update is called once per frame
void Update(){
if (Input.GetButtonDown("Fire")){
if (brujula){
timeRest = 2;
}else{
timeRest = 1;
}
}
if (time > 0){
time = time - timeRest * Time.deltaTime;
}
if (time / maxTime < 0.75f){
anim.SetFloat("State", 2);
}
if (time / maxTime < 0.5f){
anim.SetFloat("State", 3);
}
if (time / maxTime < 0.25f){
anim.SetFloat("State", 4);
}
}
}