예제 #1
0
    private static Pool create_room_pool(LDtk content, FlyweightList[] prototypes, float cell_size)
    {
        Pool rooms = new Pool();

        foreach (var level in content.Levels)
        {
            rooms.add(create_room_data(level, prototypes, cell_size));
        }
        return(rooms);
    }
예제 #2
0
    void Awake()
    {
        content = json_to_LDtk("Assets/Resources/Voxel.ldtk");
        rooms   = create_room_pool(content, flyweights, cell_size);

        var world_data = create_world_data(PlayerSpawnPosition, rooms, flyweights, cell_size);

        world_data.cut_out_doors(flyweights[0]);
        world = create_world(world_data);
    }
예제 #3
0
    void Awake()
    {
        content = json_to_LDtk("Assets/Resources/Voxel.ldtk");
        rooms   = create_room_pool(content, flyweights, special_layer, cell_size);

        world_data = create_world_data(PlayerSpawnPosition, rooms, flyweights, cell_size, ref last_room);
        world_data.cut_out_doors(flyweights[0]);
        world = create_world(world_data, last_room, goal);

        EnemyController.RG = this;
    }
예제 #4
0
    private static LDtk json_to_LDtk(string path)
    {
        var json = file_to_string(path);

        return(LDtk.FromJson(json));
    }