コード例 #1
0
        async Task <RuntimeGltfInstance> LoadAsync(string path)
        {
            var instance = await Vrm10Utility.LoadAsync(path, true, true);

            // VR用 FirstPerson 設定
            var controller = instance.GetComponent <Vrm10Instance>();
            await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject);

            return(instance);
        }
コード例 #2
0
ファイル: VRM10ViewerUI.cs プロジェクト: Santarh/UniVRM
        async void LoadModel(string path)
        {
            if (!File.Exists(path))
            {
                return;
            }

            Debug.LogFormat("{0}", path);
            var instance = await Vrm10Utility.LoadAsync(path, true, m_useNormalization.isOn,
                                                        awaitCaller : new RuntimeOnlyAwaitCaller(),
                                                        materialGenerator : GetVrmMaterialDescriptorGenerator(m_useUrpMaterial.isOn),
                                                        metaCallback : m_texts.UpdateMeta);

            if (instance == null)
            {
                // fallback to gltf
                instance = await GltfUtility.LoadAsync(path, awaitCaller : new RuntimeOnlyAwaitCaller());
            }
            SetModel(instance);
        }