File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
org.mixedrealitytoolkit.input
Visualizers/ControllerVisualizer Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 3535 "expression": "",
3636 "define": "GLTFAST_PRESENT"
3737 },
38+ {
39+ "name": "com.unity.cloud.gltfast",
40+ "expression": "6.11",
41+ "define": "GLTFAST_6_11_OR_NEWER"
42+ },
3843 {
3944 "name": "com.atteneder.gltfast",
4045 "expression": "",
4146 "define": "GLTFAST_PRESENT"
4247 },
48+ {
49+ "name": "com.atteneder.gltfast",
50+ "expression": "6.11",
51+ "define": "GLTFAST_6_11_OR_NEWER"
52+ },
53+ {
54+ "name": "com.atteneder.gltfast",
55+ "expression": "5",
56+ "define": "GLTFAST_5_0_OR_NEWER"
57+ },
4358 {
4459 "name": "com.unity.xr.management",
4560 "expression": "4.2",
Original file line number Diff line number Diff line change @@ -105,9 +105,21 @@ public async static Task<GameObject> TryGenerateControllerModelFromPlatformSDK(s
105105
106106 // Finally try to create a GameObject from the model data
107107 GltfImport gltf = new GltfImport ( ) ;
108- bool success = await gltf . LoadGltfBinary ( modelStream ) ;
109108 gltfGameObject = new GameObject ( modelKey . ToString ( ) ) ;
110- if ( success && await gltf . InstantiateMainSceneAsync ( gltfGameObject . transform ) )
109+
110+ if (
111+ #if GLTFAST_6_11_OR_NEWER
112+ await gltf . Load ( modelStream )
113+ #else
114+ await gltf . LoadGltfBinary ( modelStream )
115+ #endif
116+ &&
117+ #if GLTFAST_5_0_OR_NEWER
118+ await gltf . InstantiateMainSceneAsync ( gltfGameObject . transform )
119+ #else
120+ gltf . InstantiateMainScene ( gltfGameObject . transform )
121+ #endif
122+ )
111123 {
112124 // After all the awaits, double check that another task didn't finish earlier
113125 if ( controllerModelDictionary . TryGetValue ( modelKey , out GameObject existingGameObject ) && existingGameObject != null )
You can’t perform that action at this time.
0 commit comments