private void ChangeEnemySpawn(string time) { float finalValue; if (!float.TryParse(time, out finalValue)) { finalValue = PlayerPrefs.GetFloat("EnemySpawnTime", _enemySpawnManager.GetDefaultSecondsToSpawn()); _enemySpawnInput.placeholder.GetComponent <TextMeshProUGUI>().text = finalValue.ToString(); } else { PlayerPrefs.SetFloat("EnemySpawnTime", finalValue); } }
private void OnEnable() { _gameManager = GameManager.Instance; _enemySpawnManager = EnemySpawnManager.Instance; float sessionTime = PlayerPrefs.GetFloat("SessionTime", _gameManager.GetDefaultSessionTime()); _gameSessionSlider.value = sessionTime; UpdateSessionHandle(sessionTime); float enemySpawnTime = PlayerPrefs.GetFloat("EnemySpawnTime", _enemySpawnManager.GetDefaultSecondsToSpawn()); _enemySpawnInput.placeholder.GetComponent <TextMeshProUGUI>().text = enemySpawnTime.ToString(); }