@@ -0,0 +1,2221 @@
+package ca.blarg.gdx.tilemap3d.json.tilemesh;%0A%0Aimport ca.blarg.gdx.graphics.atlas.TextureAtlas;%0Aimport ca.blarg.gdx.tilemap3d.tilemesh.MaterialTileMapping;%0Aimport ca.blarg.gdx.tilemap3d.tilemesh.TileMesh;%0Aimport com.badlogic.gdx.assets.AssetDescriptor;%0Aimport com.badlogic.gdx.assets.AssetLoaderParameters;%0Aimport com.badlogic.gdx.assets.AssetManager;%0Aimport com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader;%0Aimport com.badlogic.gdx.assets.loaders.FileHandleResolver;%0Aimport com.badlogic.gdx.files.FileHandle;%0Aimport com.badlogic.gdx.graphics.g3d.Model;%0Aimport com.badlogic.gdx.utils.Array;%0A%0A@SuppressWarnings(%22unchecked%22)%0Apublic class TileMeshLoader extends AsynchronousAssetLoader%3CTileMesh, TileMeshLoader.TileMeshParameter%3E %7B%0A%09public static class TileMeshParameter extends AssetLoaderParameters%3CTileMesh%3E %7B%0A%09%7D%0A%0A%09public TileMeshLoader(FileHandleResolver resolver) %7B%0A%09%09super(resolver);%0A%09%7D%0A%0A%09JsonTileMesh definition;%0A%09TileMesh mesh;%0A%0A%09@Override%0A%09public Array%3CAssetDescriptor%3E getDependencies(String fileName, FileHandle file, TileMeshParameter parameter) %7B%0A%09%09definition = TileMeshJsonLoader.load(file);%0A%09%09Array%3CAssetDescriptor%3E deps = new Array%3CAssetDescriptor%3E();%0A%0A%09%09if (definition.materials != null)%0A%09%09%09deps.add(new AssetDescriptor(definition.materials, MaterialTileMapping.class));%0A%09%09if (definition.textureAtlas != null)%0A%09%09%09deps.add(new AssetDescriptor(definition.textureAtlas, TextureAtlas.class));%0A%0A%09%09if (!definition.cube) %7B%0A%09%09%09if (definition.model != null)%0A%09%09%09%09deps.add(new AssetDescriptor(definition.model, Model.class));%0A%09%09%09else if (definition.models != null && definition.models.size() %3E 0) %7B%0A%09%09%09%09for (int i = 0; i %3C definition.models.size(); ++i)%0A%09%09%09%09%09deps.add(new AssetDescriptor(definition.models.get(i).submodel, Model.class));%0A%09%09%09%7D%0A%0A%09%09%09if (definition.collisionModel != null)%0A%09%09%09%09deps.add(new AssetDescriptor(definition.collisionModel, Model.class));%0A%09%09%7D%0A%0A%09%09return deps;%0A%09%7D%0A%0A%09@Override%0A%09public void loadAsync(AssetManager manager, String fileName, FileHandle file, TileMeshParameter parameter) %7B%0A%09%09mesh = TileMeshJsonLoader.create(definition, manager);%0A%09%7D%0A%0A%09@Override%0A%09public TileMesh loadSync(AssetManager manager, String fileName, FileHandle file, TileMeshParameter parameter) %7B%0A%09%09return mesh;%0A%09%7D%0A%7D%0A

add TileMesh libgdx asset loader