Commit 0bf5fc3c authored by astatham's avatar astatham
Browse files

Implemented pie limit

parent 76355526
...@@ -12,14 +12,18 @@ public class Needle : MonoBehaviour { ...@@ -12,14 +12,18 @@ public class Needle : MonoBehaviour {
void Update() void Update()
{ {
if (PieManager.pieCount > 0)
if (Input.GetKeyDown("space")) {
{ if (Input.GetKeyDown("space"))
finalAngle = currentAngle; {
angleChangeSpeed = 0; finalAngle = currentAngle;
PowerBar.previousPos = -9f; angleChangeSpeed = 0;
} else if (!Input.GetKey("space")){ PowerBar.previousPos = -9f;
MoveNeedle(); }
else if (!Input.GetKey("space"))
{
MoveNeedle();
}
} }
} }
......
...@@ -10,8 +10,8 @@ public class PieManager : MonoBehaviour { ...@@ -10,8 +10,8 @@ public class PieManager : MonoBehaviour {
private void Update() private void Update()
{ {
/*if (pieCount > 0 && !pieInScene && !start){ if(pieCount == 0){
Needle.ResetAngles(); return;
}*/ }
} }
} }
...@@ -39,7 +39,7 @@ public class PowerBar : MonoBehaviour { ...@@ -39,7 +39,7 @@ public class PowerBar : MonoBehaviour {
currentPos += (posChangeSpeed * Time.deltaTime); currentPos += (posChangeSpeed * Time.deltaTime);
} }
if (Input.GetKeyUp("space")) if (Input.GetKeyUp("space") && PieManager.pieCount > 0)
{ {
finalPos = currentPos; finalPos = currentPos;
previousPos = currentPos; previousPos = currentPos;
......
Supports Markdown
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