private void InitializeRoom(bool moveRoom = false)
    {
        if (previousRoom != null)
        {
            Destroy(previousRoom.gameObject);
        }

        Debug.Log("setting previous room to: " + currentRoom);
        previousRoom = currentRoom;

        var roomGo = Instantiate(Resources.Load("Prefabs/Room"), currentSpawnPos, Quaternion.identity, transform) as GameObject;

        currentSpawnPos    = new Vector2(0, 0.5f);
        roomGo.name       += roomsVisited;
        currentRoom        = roomGo.GetComponent <Room>();
        currentRoomEnemies = new List <Enemy>();

        if (moveRoom)
        {
            MoveRooms();
            directionOfArrival = directionInTransit;
        }
        roomsVisited++;

        GlobalStuff.FreezeAllMovement();
        GlobalStuff.LoseAllControl();
        StartCoroutine(DelayBlockingExits());
    }
示例#2
0
    IEnumerator PauseForDramaticEffect()
    {
        //  LevelManager.Instance.Player1.GetComponent<Movement>().enabled = false;
        //   LevelManager.Instance.Player2.GetComponent<Movement>().enabled = false;
        GlobalStuff.FreezeSpawning();
        GlobalStuff.FreezeAllMovement();
        GlobalStuff.LoseAllControl();
        yield return(new WaitForSeconds(.5f));

        childWithParticleSystem.SetActive(true);
        yield return(new WaitForSeconds(2f));

        FlashScreenUI.Instance.FlashScreen(0, 1f);
        yield return(new WaitForSeconds(1.5f));

        FlashScreenUI.Instance.FlashScreen(1, 1f);
        yield return(new WaitForSeconds(1.5f));

        FlashScreenUI.Instance.FlashScreen(0, .5f);
        yield return(new WaitForSeconds(.6f));

        FlashScreenUI.Instance.FlashScreen(1, .4f);
        yield return(new WaitForSeconds(.6f));

        FlashScreenUI.Instance.FlashScreen(0, .4f);
        yield return(new WaitForSeconds(.6f));

        FlashScreenUI.Instance.FlashScreen(2, 1f);
        yield return(new WaitForSeconds(.9f));

        childWithParticleSystem.SetActive(false);
        yield return(new WaitForSeconds(.5f));

        DeactivateUltimate();
    }
示例#3
0
    public override void Die()
    {
        isPlayerDead = true;

        if (!LevelManager.Instance.isOnePlayerDead)
        {
            LevelManager.Instance.isOnePlayerDead = true;
            DisablePlayer();
        }
        else
        {
            GlobalStuff.FreezeSpawning();
            GlobalStuff.FreezeAllMovement();
            Debug.Log("Game Over");
            gameOverText.SetActive(true);

            StartCoroutine(EndGameWait());
            // TODO: GameOver
        }
    }