Esempio n. 1
0
    // abrir puerta sereta o salida secreta
    private void TurnLevelExitAndSecretDoor()
    {
        SecretDoor secretDoor = FindObjectOfType <SecretDoor>();
        LevelExit  levelExit  = FindObjectOfType <LevelExit>();

        if (levelExit)
        {
            // print("hay salida");
            if (tortchOn >= tortchInScene.Count)
            {
                // print("aparece salida");
                levelExit.ActivateLevelExit();
            }
            else
            {
                levelExit.DeactivateLevelExit();
            }
        }
        if (secretDoor)
        {
            //print("Hay secret door");
            if (secretDoorTortchOn >= secretDoorTortchInScene.Count)
            {
                //print("Desaparece secret door");
                secretDoor.OpenSecretDoor();
            }
            else
            {
                secretDoor.CloseSecretDoor();
            }
        }
    }