예제 #1
0
    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);
        }
    }
예제 #2
0
    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();
    }