mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 10:24:42 -05:00
Resolved many merge conflicts
This commit is contained in:
@@ -11,26 +11,27 @@ public class Nitro : MonoBehaviour
|
||||
private float coolDown;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
void Start()
|
||||
{
|
||||
playerStats = GetComponent<PlayerStats>();
|
||||
coolDown = 5.0f;
|
||||
//retrieves
|
||||
driver = FindObjectOfType<CoolDown>();
|
||||
}
|
||||
|
||||
//// Update is called once per frame
|
||||
//void Update(){
|
||||
// //once cooldowns are implemented, put this on one (a long one)
|
||||
// if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false){
|
||||
// playerStats.CurVel = playerStats.MaxVel;
|
||||
// StartCoroutine(startCoolDown());
|
||||
// }
|
||||
//}
|
||||
//private IEnumerator startCoolDown(){
|
||||
// Debug.Log("start corotine");
|
||||
// isOnCoolDown = true;
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//once cooldowns are implemented, put this on one (a long one)
|
||||
if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false)
|
||||
{
|
||||
playerStats.CurVel = playerStats.MaxVel;
|
||||
StartCoroutine(startCoolDown());
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator startCoolDown(){
|
||||
Debug.Log("start corotine");
|
||||
isOnCoolDown = true;
|
||||
// driver.startUICooldown("Nitro");
|
||||
// yield return new WaitForSeconds(coolDown);
|
||||
// isOnCoolDown = false;
|
||||
//}
|
||||
yield return new WaitForSeconds(coolDown);
|
||||
isOnCoolDown = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user