public static LocalHighScore getInstance() { if (instance == null) { instance = new LocalHighScore(); } return instance; }
// Use this for initialization void Start() { Screen.orientation = (ScreenOrientation)PlayerPrefs.GetInt("ScreenOrientation", (int)ScreenOrientation.LandscapeLeft); shapeController = GetComponent<ShapeController>(); swipeController = GetComponent<SwipeController>(); playerBody = GetComponent<Rigidbody2D>(); localHighScores = GetComponent<LocalHighScore>(); levelGenerator = GetComponent<LevelGenerator>(); levelGenerator.AddAllPrefabsToPooler(); maxPlayerSpeedSquared = MaxPlayerSpeed * MaxPlayerSpeed; //Restart(); StartCoroutine(MoveTowardsGoalCoroutine()); }
// Use this for initialization void Start() { _highScoreCanvas = GetComponentInChildren<Canvas>(); PlayerNameInputText = _highScoreCanvas.GetComponentInChildren<InputField>(); if(PlayerNameInputText != null) { Text[] inputTexts = PlayerNameInputText.gameObject.GetComponentsInChildren<Text>(); foreach(Text t in inputTexts) { if (t.name == "Placeholder") t.text = UsersData.DEFAULT_NAME; } } Text[] texts = _highScoreCanvas.GetComponentsInChildren<Text>(); foreach(Text t in texts) { t.fontSize = (int)(t.fontSize * ((Screen.width) / 1236f)); if (t.name.Contains("Player Name")) RankPlayerNameText = t; else if(t.name.Contains("Scores")) RankScoreText = t; } obj_localHighScore = LocalHighScore.getInstance(); obj_localHighScore.setMaxUser(maxNumOfUsers); minScore = obj_localHighScore.getMinScore(); LoadScores(); }