Exemple #1
0
    private void Update()
    {
        //sets the enum to the enum of the enemy
        enemy = enemyBasementAi.EnemyBehaviour;

        //sets the enum of the basementdoor to the gamemanager
        door = enemyBasementAi.basementDoor;

        //sets enum of the player to the playerbehaviour enum
        player = getOutOfChair.playerBehaviour;

        CheckIfPLayerIsDead();
    }
Exemple #2
0
    private void OpenOrClosed()
    {
        if (chanceToOpenDoor <= 1)
        {
            basementDoor = BasementDoor.closed;

            DelayUp();
        }
        else if (chanceToOpenDoor == 2)
        {
            basementDoor = BasementDoor.open;

            DelayUp();
        }
    }
Exemple #3
0
    //moves the enemy upstairs and plays the audio for going upstairs
    private void MoveEnemyUpstairs()
    {
        if (EnemyBehaviour == EnemyBehaviour.isDownstairs)
        {
            enemyAudioSource.clip = audioClips[1];

            if (!enemyAudioSource.isPlaying)
            {
                enemyAudioSource.Play();
                audioChance = 0;
            }

            gameObject.transform.position = startPoint.position;

            basementDoor   = BasementDoor.closed;
            EnemyBehaviour = EnemyBehaviour.isUpstairs;
        }
    }