Unity3d assets metadata
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tools
.gitignore
LICENSE
README.md
appveyor.yml

README.md

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.