Skip to content

Commit

Permalink
Update usage of KTX_PRESENT
Browse files Browse the repository at this point in the history
Update ControllerModelLoader.cs
  • Loading branch information
keveleigh committed Jan 9, 2025
1 parent 3470b6f commit 9507104
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions org.mixedrealitytoolkit.input/Editor/MRTK.Input.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
"expression": "",
"define": "GLTFAST_PRESENT"
},
{
"name": "com.unity.cloud.ktx",
"expression": "",
"define": "KTX_PRESENT"
},
{
"name": "com.atteneder.ktx",
"expression": "",
"define": "KTX_PRESENT"
},
{
"name": "com.unity.xr.management",
"expression": "4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;

#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT && KTX_PRESENT
#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT
using Microsoft.MixedReality.OpenXR;
using GLTFast;
#endif // MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT && KTX_PRESENT
#endif // MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT

namespace MixedReality.Toolkit.Input
{
Expand Down Expand Up @@ -41,7 +41,7 @@ public static class ControllerModelLoader
/// </summary>
/// <param name="inputDevice">The input device we are trying to get the controller model of</param>
/// <param name="handedness">The handedness of the input device requesting the controller model</param>
/// <returns>A gameobject representing the generated controller model in the scene</returns>
/// <returns>A GameObject representing the generated controller model in the scene</returns>
public async static Task<GameObject> TryGenerateControllerModelFromPlatformSDK(InputDevice inputDevice, Handedness handedness)
{
// Sanity check to ensure that the xrInputDevice's usages matches the provided handedness
Expand All @@ -51,7 +51,7 @@ public async static Task<GameObject> TryGenerateControllerModelFromPlatformSDK(I
// Proceed with trying to load the model from the platform
GameObject gltfGameObject = null;

#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT && KTX_PRESENT
#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT
ControllerModel controllerModelProvider = handedness == Handedness.Left ? ControllerModel.Left :
handedness == Handedness.Right ? ControllerModel.Right :
null;
Expand Down Expand Up @@ -132,7 +132,7 @@ public async static Task<GameObject> TryGenerateControllerModelFromPlatformSDK(I
}
#else
await Task.CompletedTask;
#endif // MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT && KTX_PRESENT
#endif // MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID) && GLTFAST_PRESENT

return gltfGameObject;
}
Expand Down

0 comments on commit 9507104

Please sign in to comment.