Code Monkey home page Code Monkey logo

giacomelli.unity.metadata's Introduction

Giacomelli.Unity.Metadata

Build status License Coverage Status FxCop DupFinder

Library to read metadata from Unity3d asset files when "Asset Serialization" mode is "Force text".


Code quality

  • Tested on Unity 5.3.6
  • 100% unit test code coverage.
  • FxCop validated.
  • Code duplicated verification.
  • Good (and well used) design patterns.

Usage

Initialize

Just call the line below to initilize all default services.

MetadataBootstrap.Setup();

Get scripts metadata

var log = MetadataBootstrap.Log;
var service = MetadataBootstrap.ScriptMetadataService;
var scriptsMetadata = service.GetScripts();

foreach(var sm in scriptsMetadata)
{
	Log.Debug("FileId: {0}", sm.FileId);
	Log.Debug("FullName: {0}", sm.FullName);
	Log.Debug("Name: {0}", sm.Name);
	Log.Debug("Guid: {0}", sm.Guid);
}

Get prefabs metadata

var log = MetadataBootstrap.Log;
var service = MetadataBootstrap.PrefabMetadataService;
var prefabsMetadata = service.GetPrefabs();

foreach(var pm in prefasMetadata)
{
	Log.Debug("Name: {0}", pm.Name);
	Log.Debug("Path: {0}", pm.Path);
	Log.Debug("MonoBehaviours count: {0}", pm.MonoBehaviours.Count());
	Log.Debug("Materials count: {0}", pm.Materials.Count());
}

Fix "Missing (Mono Script)"

var prefabService = MetadataBootstrap.PrefabMetadataService;
var prefabs = prefabService.GetPrefabs();
var typeService = MetadataBootstrap.TypeService;
var assetRepository = MetadataBootstrap.AssetRepository;

foreach (var prefab in prefabs)
{
    var missingMonoBehaviours = prefab.GetMissingMonoBehaviours(assetRepository, typeService);

    prefabService.FixMissingMonobehaviours(prefab, missingMonoBehaviours);
}

FAQ

Having troubles?


How to improve it?

Create a fork of Giacomelli.Unity.Metadata.

Did you change it? Submit a pull request.

License

Licensed under the The MIT License (MIT). In others words, you can use this library for developement any kind of software: open source, commercial, proprietary and alien.

giacomelli.unity.metadata's People

Contributors

giacomelli avatar liuxinjia 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.