diff --git a/Editor/ControllerPopupWindow.cs b/Editor/ControllerPopupWindow.cs index d684d7a93..7a619e9d3 100644 --- a/Editor/ControllerPopupWindow.cs +++ b/Editor/ControllerPopupWindow.cs @@ -77,6 +77,11 @@ private void OnFocus() currentControllerTexture = ControllerMappingLibrary.GetControllerTexture(controllerDataProviderProfile); } + /// + /// Shows the controller pop out window using the provided profile and serialized interaction mapping property + /// + /// + /// public static void Show(MixedRealityControllerMappingProfile profile, SerializedProperty interactionMappingProfiles) { var handednessTitleText = profile.Handedness != Handedness.None ? $"{profile.Handedness} Hand " : string.Empty; @@ -86,8 +91,14 @@ public static void Show(MixedRealityControllerMappingProfile profile, Serialized window.Close(); } - window = (ControllerPopupWindow)CreateInstance(typeof(ControllerPopupWindow)); + if (profile.ControllerType?.Type == null) + { + Debug.LogError($"No controller type defined for {profile.name}"); + return; + } + window.currentControllerName = profile.ControllerType.Type.Name; + window = (ControllerPopupWindow)CreateInstance(typeof(ControllerPopupWindow)); window.titleContent = new GUIContent($"{window.currentControllerName} {handednessTitleText}Input Action Assignment"); window.controllerDataProviderProfile = profile;