Ejemplo n.º 1
0
        private void Update()
        {
            TimeBeforeWriting -= Time.deltaTime;

            if (TimeBeforeWriting <= 0.0f)
            {
                if (loadText && !coroutineProtect)
                {
                    StartCoroutine(LoadLetters(uiTextCopy));
                    coroutineProtect = true;
                }

                else if (loadText && coroutineProtect)
                {
                    uiText.text = showText;
                }

                else if (!loadText && !coroutineProtect)
                {
                    if (uiText.text != uiTextCopy)
                    {
                        TextInformations();
                    }
                }
            }



            if (!gameOver.isPlaying && fini == true)
            {
                StartCoroutine(cameraShake.Shake(2f, 10f));
                gameOver.clip = explosion;
                gameOver.Play();
                cameraShake.GetComponent <UnityEngine.Video.VideoPlayer>().Play();
                fini = false;
            }
        }