Skip to content

Avatarchik/Giacomelli.Unity.Metadata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • 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.

About

Unity3d assets metadata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%