Ejemplo n.º 1
0
    public void buildNextLevel(Collider2D other)
    {
        floorGenerator = GameObject.FindGameObjectWithTag("GameController").GetComponent <FloorGenerator> ();
        floorGenerator.numberOfRooms += 2;
        floorGenerator.level         += 1;
        //Debug.Log (floorGenerator.level);

        var r = floorGenerator._roomPrefabs.First();

        r.transform.position = new Vector3(0, 0f, 0);

        floorGenerator._firstRoom = r;
        floorGenerator.ClearFloor();
        floorGenerator.TryGenerateFloor();

        other.transform.position = Vector3.zero;
        floorGenerator.Grid.FirstRoom.OnPlayerEntersRoom(other.GetComponent <Player> ());

        GameObject.FindGameObjectWithTag("MainCamera").transform.position = new Vector3(0, 0, -10);
    }