Giter VIP home page Giter VIP logo

assetstools's Introduction

AssetsTools

This is an AssetBundle manipulation library for C# inspired by Unity Asset Bundle Extractor.

Features

  • Supports Loading/Saving AssetBundle file with or without LZ4 compression
  • Supports Loading/Storing AssetsFile from AssetBundle
  • Supports Loading Object from AssetsFile as a DynamicObject
  • Supports Storing Object to AssetsFile with the content of DynamicObject
  • Supports .NET 4.6.1/.NET Standard 2.0

Installation

Use NuGet package. (AssetsTools by grainrigi)

Examples

Rewriting m_IsReadable flag of Texture2D

using AssetsTools;
using AssetsTools.Dynamic;

public static class Program {
	public static void Main() {
		// Load AssetBundle
		AssetBundleFile bundle = AssetBundleFile.LoadFromFile("texture.unity3d");
		
		// Load AssetsFile
		AssetsFile assets = bundle.Files[0].ToAssetsFile();
		
		// Rewrite Texture2D Objects
		foreach(var obj in assets.ObjectsWithClass(ClassIDType.Texture2D)) {
			DynamicAsset tex = obj.ToDynamicAsset();
			tex.AsDynamic().m_IsReadable = true;
			obj.LoadDynamicAsset(tex);
		}
		
		// Store the modified AssetsFile
		bundle.Files[0].LoadAssetsFile(assets);
		
		// Save the AssetBundle
		bundle.SaveToFile("texture.mod.unity3d");
	}
}

How to build

Prerequisits

  • Visual Studio 2017 or dotnet
  • .NET Framework 4.6.1 (for net461 build)
  • .NET Core 2.0 (for netstandard2.0 build)

With VS2017

Just load the AssetsTools.sln and build the whole solution.

With dotnet

Just execute dotnet build in the root directory.

License

MIT

assetstools's People

Contributors

grainrigi avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.