mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 02:14:30 -05:00
Fixed indicator and CooldownUI
This commit is contained in:
@@ -5,6 +5,7 @@ using UnityEngine;
|
||||
|
||||
|
||||
public class Dash : NetworkBehaviour{
|
||||
private CoolDown driver;
|
||||
public Vector3 moveDirection;
|
||||
|
||||
public const float maxDashTime = 1.0f;
|
||||
@@ -19,6 +20,7 @@ public class Dash : NetworkBehaviour{
|
||||
PlayerMovement pMove;
|
||||
|
||||
void Start(){
|
||||
driver = GameObject.Find("Canvas").GetComponent<CoolDown>();
|
||||
characterController = this.gameObject.GetComponent<CharacterController>();
|
||||
pMove = GetComponent<PlayerMovement>();
|
||||
}
|
||||
|
||||
@@ -4,15 +4,16 @@ using UnityEngine;
|
||||
|
||||
public class Nitro : MonoBehaviour
|
||||
{
|
||||
private PlayerStats playerStats;
|
||||
private CoolDown driver;
|
||||
private PlayerStats playerStats;
|
||||
public SpecialItem nitroItem;
|
||||
private bool isOnCoolDown = false;
|
||||
//this will need to be set from scritable object or something;
|
||||
private float coolDown;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
driver = GameObject.Find("Canvas").GetComponent<CoolDown>();
|
||||
playerStats = GetComponent<PlayerStats>();
|
||||
}
|
||||
|
||||
@@ -30,8 +31,8 @@ public class Nitro : MonoBehaviour
|
||||
private IEnumerator startCoolDown(){
|
||||
Debug.Log("start corotine");
|
||||
isOnCoolDown = true;
|
||||
// driver.startUICooldown("Nitro");
|
||||
yield return new WaitForSeconds(coolDown);
|
||||
driver.startUICooldown("Nitro");
|
||||
yield return new WaitForSeconds(nitroItem.cooldownM);
|
||||
isOnCoolDown = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user