Commit 169cc128 authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

fixed pie throwing 'tap' spacebar bug

parent 63883711
......@@ -22,6 +22,7 @@ public class throwManager : MonoBehaviour {
public GameObject hand;
private GameObject currentPie;
private bool shotPie;
private bool loadingPie;
private float angle;
private float power;
......@@ -62,13 +63,20 @@ public class throwManager : MonoBehaviour {
}
void manageThrow(bool canThrow) {
if (Input.GetKeyUp("space") && PieManager.pieCount > 0 && canThrow) {
if (Input.GetKeyUp(KeyCode.Space) && PieManager.pieCount > 0 && canThrow) {
//unpause animation
if (loadingPie) {
anim.SetBool("ResetThrow", true);
Destroy(currentPie);
anim.speed = 1;
} else {
anim.speed = 2;
}
}
if (PieManager.pieCount > 0) {
if (Input.GetKeyDown(KeyCode.Space)) {
//load pie into players hand
anim.SetBool("ResetThrow", false);
anim.SetBool("BeginThrow", true);
anim.speed = 1;
angle = angleMeter.fillAmount;
......@@ -77,6 +85,7 @@ public class throwManager : MonoBehaviour {
AngleState = PowerIncreasing;
PowerIncreasing = true;
loadingPie = true;
}
if (Input.GetKeyUp(KeyCode.Space)) {
PowerIncreasing = AngleState;
......@@ -120,6 +129,7 @@ public class throwManager : MonoBehaviour {
public void pauseAnimation() {
anim.speed = 0;
anim.SetBool("BeginThrow", false);
loadingPie = false;
}
void fillSomething(Image thing) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment