Ejemplo n.º 1
0
    public void StartGame(bool restarting)
    {
        animateCanvases = !restarting;
        Debug.Log("Starting game");
        gameOverUI.SetActive(false);
        ScoreKeeper.instance.Reset();
        if (!restarting)
        {
            ResetPosition();
        }

        spawnTimeIndex = 0;
        targets        = FindObjectsOfType <T>();
        StartCoroutine("Countdown", "SpawnTargets");
        timeText.text = "Time:\n" + gameTime.ToString("n2");
        if (grabbable)
        {
            grabbable.Reset();
        }
        if (ballSpawner)
        {
            ballSpawner.Reset();
        }
        float highscore = PlayerPrefs.GetFloat(gameKey + "_HIGHSCORE");

        highScoreText.text = "HIGHSCORE:\n" + highscore.ToString(highscore % 1 < 0.0001 ? "N0" : "N2");
    }
Ejemplo n.º 2
0
 public void RpcGameOver()
 {
     if (isServer)
     {
         Score = 0;
         spawner.Reset();
         PoolManager.ReturnAllPollsObject();
         RpcOnClientGameOver();
         NetworkServer.DisconnectAll();
         MyNetworkManager.Instance.StopServerGame();
         //  SceneManager.LoadScene("Menu");
     }
 }
Ejemplo n.º 3
0
 public override void Start()
 {
     canGoNext = false;
     ballSpawner.Reset();
     enemySpawner.SpawnLine();
 }