示例#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");
    }
示例#2
0
 public void RpcGameOver()
 {
     if (isServer)
     {
         Score = 0;
         spawner.Reset();
         PoolManager.ReturnAllPollsObject();
         RpcOnClientGameOver();
         NetworkServer.DisconnectAll();
         MyNetworkManager.Instance.StopServerGame();
         //  SceneManager.LoadScene("Menu");
     }
 }
示例#3
0
 public override void Start()
 {
     canGoNext = false;
     ballSpawner.Reset();
     enemySpawner.SpawnLine();
 }