Created
March 8, 2022 12:44
-
-
Save nishi-yuki/b12225de7db2fecce5072a19faa0c7d8 to your computer and use it in GitHub Desktop.
VRMファイルからモデルをロードするだけ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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