Exemple #1
0
    void Detect()
    {
        Vector3         dir  = Camera.main.transform.forward;
        List <Collider> cols = ConeShowerDetection(transform, dir, myLight.range, myLight.spotAngle + addicionalAngle, nCircles, nRays);

        foreach (Collider col in cols)
        {
            if (col.CompareTag("Enemy"))
            {
                if (saveEnemy == null || saveEnemy.name != col.name)
                {
                    saveEnemy = col.gameObject.GetComponent <EnemyBehaviour>();
                }
                saveEnemy.Stop();
            }
            else if (col.CompareTag("Atormentada"))
            {
                if (saveChorona == null || saveChorona.name != col.name)
                {
                    saveChorona = col.gameObject.GetComponent <cryingStatue>();
                }
                //saveChorona.isVisible = true;
            }
        }
    }
Exemple #2
0
    protected override void comeco()
    {
        if (pontP == null)
        {
            print(gameObject.name + "não apresenta script ponteiro");
        }
        else if (pontG == null)
        {
            print(gameObject.name + "não apresenta script ponteiro");
        }

        //colocando valores iniciais
        tempo      = 0;
        tempoAtivo = tempoAtivoMax / 2;
        //horaAtual = (int)tempoDeJogo/60 -1;

        plaFpc = pla.GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController>();

        pontP.comeco(GetComponent <Relogio>(), tempoDeJogo / 6);
        pontG.comeco(GetComponent <Relogio>(), tempoDeJogo / (6 * 12));

        //colocando os audios
        audioWinding         = gameObject.AddComponent(typeof(AudioSource)) as AudioSource;
        audioTick            = gameObject.AddComponent(typeof(AudioSource)) as AudioSource;
        audioTick.clip       = tickClip;
        audioBatidaHora      = gameObject.AddComponent(typeof(AudioSource)) as AudioSource;
        audioBatidaHora.clip = batidaClip;

        textInteragir = "Dar Corda";
        audioTick.Play();

        estatuaChorando = FindObjectOfType <cryingStatue>();
    }
Exemple #3
0
    //escurece imagem até ficar tudo preto
    IEnumerator EsccurecerTela()
    {
        //desabilitando inimigo
        EnemyBehaviour eni1 = FindObjectOfType <EnemyBehaviour>();

        if (eni1 != null)
        {
            eni1.enabled = false;
        }
        cryingStatue eni2 = FindObjectOfType <cryingStatue>();

        if (eni2 != null)
        {
            eni2.enabled = false;
        }

        telaPreta.color = new Color32((byte)0, (byte)0, (byte)0, alfaTelaPreta);
        while (alfaTelaPreta < 255)
        {
            if (alfaTelaPreta > 255)
            {
                alfaTelaPreta = 255;
            }


            alfaTelaPreta   = (byte)(1 + alfaTelaPreta);
            telaPreta.color = new Color32((byte)0, (byte)0, (byte)0, alfaTelaPreta);
            yield return(new WaitForSeconds(0.01f));
        }


        //desativando inimigos
        if (eni1 != null)
        {
            eni1.gameObject.SetActive(false);
        }
        if (eni2 != null)
        {
            eni2.gameObject.SetActive(false);
        }
        //Invoke("acabarJogo",0.5f);
        SceneManager.LoadScene("EndScene");
    }