GltfParserの分離と、ImporterContextのインターフェース整理

使い方
* var parser = new GltfParser();
* parser.ParsePath(filePath); // ParseJson, ParseGlb 等パース系の関数
* context = new ImporterContext(parser); // parse から context を作る
* context.Load(); // もしくは LoadAsync で、Unity化する
This commit is contained in:
ousttrue
2021-02-22 15:52:32 +09:00
parent 0f85964a50
commit a5be5e1383
16 changed files with 374 additions and 378 deletions

View File

@@ -46,11 +46,11 @@ namespace VRM.Samples
var bytes = File.ReadAllBytes(path);
// なんらかの方法でByte列を得た
var context = new VRMImporterContext();
// GLB形式でJSONを取得しParseします
context.ParseGlb(bytes);
var parser = new GltfParser();
parser.ParseGlb(bytes);
var context = new VRMImporterContext(parser);
// metaを取得(todo: thumbnailテクスチャのロード)
var meta = await context.ReadMetaAsync();