@@ -0,0 +1,1812 @@
+#!/usr/bin/env python%0Aimport os%0Aimport sys%0Aimport unitypack%0Aimport yaml%0Afrom argparse import ArgumentParser%0A%0A%0Adef handle_asset(asset):%0A%09for id, obj in asset.objects.items():%0A%09%09d = obj.read()%0A%0A%09%09print(yaml.dump(d))%0A%0A%0Adef asset_representer(dumper, data):%0A%09return dumper.represent_scalar(%22!asset%22, data.name)%0Ayaml.add_representer(unitypack.Asset, asset_representer)%0A%0A%0Adef objectpointer_representer(dumper, data):%0A%09return dumper.represent_mapping(%22!pptr%22, %7B%0A%09%09%22file%22: data.file_id, %22path%22: data.path_id%0A%09%7D)%0Ayaml.add_representer(unitypack.ObjectPointer, objectpointer_representer)%0A%0A%0Adef textasset_representer(dumper, data):%0A%09obj = data._obj.copy()%0A%09obj%5B%22m_Script%22%5D = %22%3Cstripped%3E%22%0A%09return dumper.represent_mapping(%22!TextAsset%22, obj)%0A%0A%0Adef texture2d_representer(dumper, data):%0A%09obj = data._obj.copy()%0A%09obj%5B%22image data%22%5D = %22%3Cstripped%3E%22%0A%09return dumper.represent_mapping(%22!Texture2D%22, obj)%0A%0A%0Adef movietexture_representer(dumper, data):%0A%09obj = data._obj.copy()%0A%09obj%5B%22m_MovieData%22%5D = %22%3Cstripped%3E%22%0A%09return dumper.represent_mapping(%22!MovieTexture%22, obj)%0A%0A%0Adef main():%0A%09p = ArgumentParser()%0A%09p.add_argument(%22files%22, nargs=%22+%22)%0A%09p.add_argument(%22-s%22, %22--strip%22, action=%22store_true%22, help=%22Strip extractable data%22)%0A%09args = p.parse_args(sys.argv%5B1:%5D)%0A%0A%09if args.strip:%0A%09%09yaml.add_representer(unitypack.engine.movie.MovieTexture, movietexture_representer)%0A%09%09yaml.add_representer(unitypack.engine.text.TextAsset, textasset_representer)%0A%09%09yaml.add_representer(unitypack.engine.texture.Texture2D, texture2d_representer)%0A%0A%09for file in args.files:%0A%09%09if file.endswith(%22.assets%22):%0A%09%09%09with open(file, %22rb%22) as f:%0A%09%09%09%09asset = unitypack.Asset.from_file(f)%0A%09%09%09handle_asset(asset)%0A%09%09%09continue%0A%0A%09%09with open(file, %22rb%22) as f:%0A%09%09%09bundle = unitypack.load(f)%0A%0A%09%09for asset in bundle.assets:%0A%09%09%09handle_asset(asset)%0A%0A%0Aif __name__ == %22__main__%22:%0A%09main()%0A

Add a yaml dumper for asset bundles