Removed VRMImporter.Load

This commit is contained in:
ousttrue 2018-09-22 15:33:58 +09:00
parent 21b1c6d520
commit fa93df71bc
3 changed files with 17 additions and 18 deletions

View File

@ -14,13 +14,23 @@ namespace VRM
[Obsolete("use VRMImporterContext.Load(path)")]
public static GameObject LoadFromPath(string path)
{
return VRMImporterContext.Load(path).Root;
var context = new VRMImporterContext();
context.Parse(path, File.ReadAllBytes(path));
context.Load();
context.ShowMeshes();
context.EnableUpdateWhenOffscreen();
return context.Root;
}
[Obsolete("use VRMImporterContext.Load(bytes)")]
public static GameObject LoadFromBytes(Byte[] bytes)
{
return VRMImporterContext.Load(bytes).Root;
var context = new VRMImporterContext();
context.ParseGlb(bytes);
context.Load();
context.ShowMeshes();
context.EnableUpdateWhenOffscreen();
return context.Root;
}
[Obsolete("use VRMImporterContext.Load()")]
@ -28,6 +38,7 @@ namespace VRM
{
context.Load();
context.ShowMeshes();
context.EnableUpdateWhenOffscreen();
}
#region LoadVrmAsync

View File

@ -2,7 +2,6 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using UniGLTF;
using UnityEngine;
@ -14,24 +13,13 @@ namespace VRM
const string HUMANOID_KEY = "humanoid";
const string MATERIAL_KEY = "materialProperties";
public VRMImporterContext(UnityPath gltfPath = default(UnityPath)) : base(gltfPath)
[Obsolete]
public VRMImporterContext(UnityPath gltfPath) : base(gltfPath)
{
}
public static VRMImporterContext Load(string path)
public VRMImporterContext()
{
var context = new VRMImporterContext(UniGLTF.UnityPath.FromFullpath(path));
context.ParseGlb(File.ReadAllBytes(path));
context.Load();
return context;
}
public static VRMImporterContext Load(Byte[] bytes)
{
var context = new VRMImporterContext();
context.ParseGlb(bytes);
context.Load();
return context;
}
public override void Load()

@ -1 +1 @@
Subproject commit e0c90f42cc192b42d45be53c9fd5551cbe1b1984
Subproject commit 5595029d7446fa4c1a8136dc47527c87c5a89fdd