Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (!game_Started && sheer.found)
        {
            source.PlayOneShot(LookOverHere);
            game_Started = true;

            if (label_trigger)
            {
                start_label.SetActive(true);
                label_trigger = false;
            }
        }

        if (start_label.activeSelf)
        {
            labelimer += Time.deltaTime;
            if (labelimer >= labelTime)
            {
                start_label.SetActive(false);
                labelimer = 0.0f;
            }
        }

        if (waitToNextLvlM)
        {
            explosiontimer += Time.deltaTime;
            if (explosiontimer >= explosionTime)
            {
                explosionParticle.SetActive(true);
            }
        }

        if (waitToNextLvlM && !source.isPlaying)
        {
            waitToNextLvlM = false;
            lvlManager.NextLvl();
            transform.position = Vector3.zero;
            explosionParticle.SetActive(false);
            explosiontimer        = 0;
            sheerMovement.canMove = true;
            game_finished         = false;
        }
    }