public override void OnImportAsset(AssetImportContext ctx) { TextAsset castle = new TextAsset(File.ReadAllText(ctx.assetPath)); ctx.AddObjectToAsset("main obj", castle); ctx.SetMainObject(castle); CastleDBParser newCastle = new CastleDBParser(castle); CastleDBGenerator.GenerateTypes(newCastle.Root); }
public override void OnImportAsset(AssetImportContext ctx) { // Make sure this .img file is part of a CastleDB database if (!HasCorrespondingCDBFile(ctx.assetPath)) { return; } // Make Images Folder CastleDBGenerator.InitPath(CastleDBConfig.Instance().ImagesFolder); // Import as TextAsset TextAsset images = new TextAsset(File.ReadAllText(ctx.assetPath)); ctx.AddObjectToAsset("main obj", images); ctx.SetMainObject(images); // Decode and import images as assets data = JSON.Parse(images.text); EditorApplication.delayCall += new EditorApplication.CallbackFunction(WriteImages); }
private void GenerateTypes() { CastleDBGenerator.GenerateTypes(parser.Root, CastleDBConfig.Instance(), dbname); parser = null; dbname = ""; }
private void GenerateTypes() { CastleDBGenerator.GenerateTypes(parser.Root, GetCastleDBConfig()); parser = null; }