Skip to content

Instantly share code, notes, and snippets.

@nishi-yuki
Created March 8, 2022 12:44
Show Gist options
  • Save nishi-yuki/b12225de7db2fecce5072a19faa0c7d8 to your computer and use it in GitHub Desktop.
Save nishi-yuki/b12225de7db2fecce5072a19faa0c7d8 to your computer and use it in GitHub Desktop.
VRMファイルからモデルをロードするだけ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniGLTF;
using VRM;
using VRMShaders;
public class LoadModel : MonoBehaviour
{
RuntimeGltfInstance instance;
string path = "/path/to/vrmfile.vrm";
// Start is called before the first frame update
void Start()
{
Load();
}
// Update is called once per frame
void Update() { }
async void Load()
{
Debug.Log(path);
this.instance = await VrmUtility.LoadAsync(path, new RuntimeOnlyAwaitCaller());
// this.instance.EnableUpdateWhenOffscreen();
this.instance.ShowMeshes();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment