mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
fixed a couple of the bugs that was found in playtest 3
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class dNitro : MonoBehaviour
|
||||
{
|
||||
private PlayerStats playerStats;
|
||||
private CoolDown driver;
|
||||
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()
|
||||
{
|
||||
playerStats = GetComponent<PlayerStats>();
|
||||
}
|
||||
|
||||
// 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.HasNitro)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71b2b26f3c822f045b43d4966fb097e6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -20,7 +20,7 @@ public class dPlayCam : NetworkBehaviour
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
|
||||
offset = transform.parent.forward * rad.magnitude;
|
||||
transform.position = new Vector3((player.transform.position.x - offset.x),((player.transform.position.y - offset.y)+2),(player.transform.position.z - offset.z));
|
||||
transform.position = new Vector3((player.transform.position.x - offset.x),((player.transform.position.y - offset.y)+3),(player.transform.position.z - offset.z));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,6 +288,7 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
if(wallRun.IsWallRunning()){
|
||||
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8f);
|
||||
g = pStats.JumpPow;
|
||||
curJumpNum = 0;
|
||||
}
|
||||
|
||||
else{
|
||||
@@ -409,7 +410,7 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
//Gliding
|
||||
if(pStats.HasGlider && g < 0 && Input.GetButton("Jump")){
|
||||
//Gravity with glider
|
||||
GravityCalculation(6);
|
||||
GravityCalculation(8);
|
||||
|
||||
//Set temp values to put traction back to normal
|
||||
if(tempSet == false){
|
||||
|
||||
Reference in New Issue
Block a user