Menu camera

This commit is contained in:
2022-01-30 11:43:57 +01:00
parent e5a83b0434
commit e66a25df63
4 changed files with 5197 additions and 166 deletions

View File

@@ -10,6 +10,9 @@ public class UiController : MonoBehaviour
public TextMeshProUGUI uiDistance;
public TextMeshProUGUI uiHighScore;
public GameObject menuCamera;
public GameObject playerCamera;
public static float distance = 0;
public static int highScore = 0;
private float oldDistance = 0.0f;
@@ -23,6 +26,11 @@ public class UiController : MonoBehaviour
UiController.LoadGame();
}
public void OnStartGameBtnClick()
{
menuCamera.SetActive(false);
playerCamera.SetActive(true);
}
public static void SaveGame()
{
if (UiController.distance > UiController.highScore)

View File

@@ -7,7 +7,7 @@ public class gizmoManager : MonoBehaviour
void OnDrawGizmos()
{
if (!this.gameObject.transform.parent.name.Contains("chunk"))
if (this.gameObject != null && !this.gameObject.transform.parent.name.Contains("chunk"))
{
Bounds bounds = GetChildRendererBounds(gameObject);
Gizmos.DrawWireCube(bounds.center, bounds.size);