|
@ -10,6 +10,7 @@ using System.Linq; |
|
|
public class RacetrackGameMode : GameMode |
|
|
public class RacetrackGameMode : GameMode |
|
|
{ |
|
|
{ |
|
|
public MapManager mapManager; |
|
|
public MapManager mapManager; |
|
|
|
|
|
public blockSpawn spawn; |
|
|
|
|
|
|
|
|
public int MaxRound = 999; |
|
|
public int MaxRound = 999; |
|
|
public string nextScene = "ServerTestScene"; |
|
|
public string nextScene = "ServerTestScene"; |
|
@ -109,6 +110,7 @@ public class RacetrackGameMode : GameMode |
|
|
|
|
|
|
|
|
//We check for track sections we need to add/remove
|
|
|
//We check for track sections we need to add/remove
|
|
|
mapManager.checkTrack(); |
|
|
mapManager.checkTrack(); |
|
|
|
|
|
//spawn.wakeup();
|
|
|
|
|
|
|
|
|
//Move the camera forward at a steady rate each round
|
|
|
//Move the camera forward at a steady rate each round
|
|
|
/*if (scrollSpeed > 0.0f) |
|
|
/*if (scrollSpeed > 0.0f) |
|
@ -272,22 +274,18 @@ public class RacetrackGameMode : GameMode |
|
|
character.lives -= 1; |
|
|
character.lives -= 1; |
|
|
character.ClientLink.Lives = character.lives; |
|
|
character.ClientLink.Lives = character.lives; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private IEnumerator AnimateBlock(Material mat, float time) |
|
|
private IEnumerator AnimateBlock(Material mat, float time) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
float timeElasped = 0; |
|
|
float timeElasped = 0; |
|
|
|
|
|
|
|
|
while (timeElasped < time) |
|
|
while (timeElasped < time) |
|
|
{ |
|
|
{ |
|
|
mat.SetFloat("_Multiplier", (timeElasped / time)); |
|
|
mat.SetFloat("_Multiplier", (timeElasped / time)); |
|
|
yield return new WaitForEndOfFrame(); |
|
|
yield return new WaitForEndOfFrame(); |
|
|
|
|
|
|
|
|
timeElasped += Time.deltaTime; |
|
|
timeElasped += Time.deltaTime; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
mat.SetFloat("_Multiplier", 1); |
|
|
mat.SetFloat("_Multiplier", 1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|