Example #1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.D))
     {
         SceneManager.LoadScene(_sceneName.GetSceneName());
         PlayerPrefs.SetInt("Player", 0);
     }
     else if (Input.GetKeyDown(KeyCode.A))
     {
         SceneManager.LoadScene(_sceneName.GetSceneName());
         PlayerPrefs.SetInt("Player", 1);
     }
 }
Example #2
0
    private void Update()
    {
        if (_textMesh.color.a >= 0.95f && !_finishedInit)
        {
            _continueText.gameObject.SetActive(true);
            _continueText.gameObject.GetComponent <BackgroundAnimation>().Activate();
            _skipText.gameObject.SetActive(true);
            _finishedInit = true;
        }

        if (!_finishedInit)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            SceneManager.LoadScene(_sceneName.GetSceneName());
        }

        _curTimer += Time.deltaTime;

        if (_curTimer > _actionTimer)
        {
            if (Input.anyKey)
            {
                _curTimer = 0;
                _curIndex++;

                if (_curIndex >= _text.Count)
                {
                    SceneManager.LoadScene(_sceneName.GetSceneName());
                }
                else
                {
                    _textMesh.text = _text[_curIndex];
                }
            }
        }
    }