public void levelComplete() { pauzeButtonScript.pauseNoMenu(); pauzeButton.interactable = false; levelCompleteSprite.GetComponent <Renderer>().enabled = true; revealBackground(); player.GetComponent <SpriteRenderer>().enabled = false; enemy.GetComponent <SpriteRenderer>().enabled = false; if (levelManager.isLastLevel()) { gameOverPanel.SetActive(true); } else { levelCompletePanel.SetActive(true); } LevelProgress.progress.completeLevel(levelManager.currentLevelIndex); LevelProgress.progress.save(); // google analytics int playerId = PlayerPrefs.GetInt("playerId"); googleAnalytics.LogEvent("Level succesfull - " + getLevelManager().currentLevelIndex, "Player: " + playerId + ", number of moves for level " + getLevelManager().currentLevelIndex, "Moves: " + areaCapture.getNumberOfMoves(), 1); float timePassed = Time.time - startTime; googleAnalytics.LogTiming("Level Timing", Convert.ToInt64(timePassed) * 1000, "Player: " + playerId + ", Complete Level", "Level " + getLevelManager().currentLevelIndex); googleAnalytics.DispatchHits(); }
public void SprayEnd() { spraying = false; float elapsedTime = Time.fixedTime - startTime; googleAnalytics.LogEvent("Spray", "Stop Spraying", "camera-facing: " + cameraFacing.ToString() + " brush-size: " + brushSize.ToString(), 1); googleAnalytics.LogTiming("Spray Length", Convert.ToInt64(elapsedTime), "camera-facing: " + cameraFacing.ToString(), "brush-size: " + brushSize.ToString()); if (SprayEnded != null) { SprayEnded(); } }