|
|
|
|
|
|
Entity ballEntityPrefab; |
|
|
|
EntityManager manager; |
|
|
|
|
|
|
|
WaitForSeconds oneSecond; |
|
|
|
WaitForSeconds delay; |
|
|
|
|
|
|
|
private void Awake() |
|
|
|
{ |
|
|
|
if (main != null && main != this) |
|
|
|
|
|
|
main = this; |
|
|
|
playerScores = new int[2]; |
|
|
|
|
|
|
|
manager = World.Active.EntityManager; |
|
|
|
manager = World.DefaultGameObjectInjectionWorld.EntityManager; |
|
|
|
oneSecond = new WaitForSeconds(1f); |
|
|
|
delay = new WaitForSeconds(respawnDelay); |
|
|
|
|
|
|
|
StartCoroutine(CountdownAndSpawnBall()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
IEnumerator CountdownAndSpawnBall() |
|
|
|
{ |
|
|
|
mainText.text = "Get Ready"; |
|
|
|
yield return new WaitForSeconds(respawnDelay); |
|
|
|
yield return delay; |
|
|
|
WaitForSeconds delay = new WaitForSeconds(1f); |
|
|
|
yield return delay; |
|
|
|
yield return oneSecond; |
|
|
|
|
|
|
|
yield return delay; |
|
|
|
yield return oneSecond; |
|
|
|
|
|
|
|
yield return delay; |
|
|
|
yield return oneSecond; |
|
|
|
|
|
|
|
mainText.text = ""; |
|
|
|
|
|
|
|