Last active
August 29, 2015 13:55
-
-
Save poemdexter/8701919 to your computer and use it in GitHub Desktop.
ping pong dongs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POWvalue is current value of potential score | |
// POWProgress.value is current position of POW bar | |
void Increment() | |
{ | |
we initiate a new float every Increment() that will hold new value of the POWProgress.value as it pingpongs | |
POWProgress.value = Mathf.PingPong(Time.deltaTime, 1); | |
} | |
int Calculate() | |
{ | |
int scoreValue = Mathf.CeilToInt(POWProgress.value * 100); | |
Debug.Log("POW: " + scoreValue); | |
return scoreValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment