mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-20 09:34:42 -05:00
mv Vrm10Utility to Vrm10
This commit is contained in:
@@ -6,7 +6,10 @@ using VRMShaders;
|
||||
|
||||
namespace UniVRM10
|
||||
{
|
||||
public static class Vrm10Utility
|
||||
/// <summary>
|
||||
/// High-level VRM-1.0 loading API.
|
||||
/// </summary>
|
||||
public static class Vrm10
|
||||
{
|
||||
public delegate void MetaCallback(Texture2D thumbnail, UniGLTF.Extensions.VRMC_vrm.Meta meta1, Migration.Vrm0Meta meta0);
|
||||
public static async Task<RuntimeGltfInstance> LoadPathAsync(string path,
|
||||
@@ -22,12 +22,12 @@ namespace UniVRM10.Sample
|
||||
async void Run()
|
||||
{
|
||||
var src = new FileInfo(m_vrmPath);
|
||||
var instance = await Vrm10Utility.LoadPathAsync(m_vrmPath, true, true);
|
||||
var instance = await Vrm10.LoadPathAsync(m_vrmPath, true, true);
|
||||
|
||||
var exportedBytes = Vrm10Exporter.Export(instance.gameObject);
|
||||
|
||||
// Import 1.0
|
||||
var vrm10 = await Vrm10Utility.LoadBytesAsync("tmp.vrm", exportedBytes, false, true);
|
||||
var vrm10 = await Vrm10.LoadBytesAsync("tmp.vrm", exportedBytes, false, true);
|
||||
var pos = vrm10.transform.position;
|
||||
pos.x += 1.5f;
|
||||
vrm10.transform.position = pos;
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace UniVRM10
|
||||
{
|
||||
try
|
||||
{
|
||||
Vrm10Utility.LoadPathAsync(gltf.FullName, true, false).Wait();
|
||||
Vrm10.LoadPathAsync(gltf.FullName, true, false).Wait();
|
||||
}
|
||||
catch (UnNormalizedException)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace UniVRM10
|
||||
|
||||
public static Vrm10Instance LoadAlicia()
|
||||
{
|
||||
var task = Vrm10Utility.LoadPathAsync(AliciaPath, true, true);
|
||||
var task = Vrm10.LoadPathAsync(AliciaPath, true, true);
|
||||
task.Wait();
|
||||
var instance = task.Result;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace UniVRM10.FirstPersonSample
|
||||
|
||||
async Task<RuntimeGltfInstance> LoadAsync(string path)
|
||||
{
|
||||
var instance = await Vrm10Utility.LoadPathAsync(path, true, true);
|
||||
var instance = await Vrm10.LoadPathAsync(path, true, true);
|
||||
|
||||
// VR用 FirstPerson 設定
|
||||
var controller = instance.GetComponent<Vrm10Instance>();
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
}
|
||||
|
||||
Debug.LogFormat("{0}", path);
|
||||
var instance = await Vrm10Utility.LoadPathAsync(path, true, m_useNormalization.isOn,
|
||||
var instance = await Vrm10.LoadPathAsync(path, true, m_useNormalization.isOn,
|
||||
awaitCaller: new RuntimeOnlyAwaitCaller(),
|
||||
materialGenerator: GetVrmMaterialDescriptorGenerator(m_useUrpMaterial.isOn),
|
||||
metaCallback: m_texts.UpdateMeta);
|
||||
|
||||
Reference in New Issue
Block a user