Beispiel #1
0
    public void DeactivateDialogueBox()
    {
        isActivated = false;
        animator.SetBool("isActivated", isActivated);

        PuzzleButtonThree puzzleButton = FindObjectOfType <PuzzleButtonThree>();

        puzzleButton.PlayPuzzleSounds();

        StartCoroutine(DeactivateCo());
    }
Beispiel #2
0
    public void ResumeGame()
    {
        gameIsPaused             = false;
        Time.timeScale           = 1.0f;
        playerController.canMove = true; //for animations, sounds

        Scene scene = SceneManager.GetActiveScene();

        if (scene.name == "Level3Puzzle3")
        {
            PuzzleButtonThree puzzleButton = FindObjectOfType <PuzzleButtonThree>();

            if (puzzleButton.wasButtonActivated && !puzzleButton.isPuzzleSolved)
            {
                playerController.canMove = false;
            }
        }

        HidePauseMenu();
    }
Beispiel #3
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Pearl")
        {
            AudioSource pearlAudio = other.GetComponent <AudioSource>();
            if (pearlAudio.isPlaying)
            {
                pearlAudio.Stop();
            }

            Pearl pearl = other.GetComponent <Pearl>();

            if (collisionChecker.collisions.above)
            {
                pearl.MoveUp();
            }
            else if (collisionChecker.collisions.below)
            {
                pearl.MoveDown();
            }
            else if (collisionChecker.collisions.left)
            {
                pearl.MoveLeft();
            }
            else if (collisionChecker.collisions.right)
            {
                pearl.MoveRight();
            }
        }

        if (other.tag == "PearlInteractZone")
        {
            Pearl pearl = other.GetComponentInParent <Pearl>();

            if (!pearl.hasBeenPushed)
            {
                pearl.PlayPuzzleSound();
            }
        }

        if (other.tag == "InteractZone")
        {
            InteractZone zone = other.GetComponent <InteractZone>();
            zone.ActivatedButtonSprite();
        }

        if (other.tag == "PuzzleShellTwo")
        {
            ShellPuzzleTwo shell = other.GetComponent <ShellPuzzleTwo>();
            shell.ActivateShell();
        }

        if (other.tag == "PuzzleShellTwoInteractZone")
        {
            ShellPuzzleTwo shell = other.GetComponentInParent <ShellPuzzleTwo>();
            shell.PlayShellSound();
            shell.ActivatedButtonSprite();
        }

        if (other.tag == "PuzzleButtonOne")
        {
            PuzzleButtonOne button = other.GetComponentInParent <PuzzleButtonOne>();

            if (!button.isPuzzleSolved)
            {
                button.PlayPuzzleSounds();
            }
        }

        if (other.tag == "PuzzleButtonTwo")
        {
            PuzzleButtonTwo button = other.GetComponentInParent <PuzzleButtonTwo>();

            if (!button.isPuzzleSolved)
            {
                button.PlayPuzzleSounds();
            }
        }

        if (other.tag == "PuzzleButtonThree")
        {
            PuzzleButtonThree button = other.GetComponent <PuzzleButtonThree>();

            if (!button.isPuzzleSolved)
            {
                button.ActivateDialogueBox();
                canMove = false;
            }
        }

        if (other.tag == "EnterZone")
        {
            MountainEntry mountain = other.GetComponent <MountainEntry>();

            int mountainNumber = mountain.mountainNumber;
            gameManager.currentMountainNumber = mountainNumber;

            mountain.EnterMountain();
        }

        if (other.tag == "ExitZone")
        {
            gameManager.playerExitingMountain = true;
            MountainExit mountain = other.GetComponent <MountainExit>();
            mountain.ExitMountain();
        }

        if (other.tag == "GrassZone")
        {
            playerSoundManager.surface = PlayerSoundManager.Surface.grass;
        }
    }
 private void Awake()
 {
     pieces       = FindObjectsOfType <Piece>();
     puzzleButton = FindObjectOfType <PuzzleButtonThree>();
     player       = FindObjectOfType <PlayerController>();
 }