Beispiel #1
0
        protected override void OnEnable()
        {
            base.OnEnable();

            inputActionRulesProfile = target as MixedRealityInputActionRulesProfile;
            Debug.Assert(inputActionRulesProfile != null);

            inputSystemProfile = inputActionRulesProfile.ParentProfile as MixedRealityInputSystemProfile;
            Debug.Assert(inputSystemProfile != null);

            if (inputSystemProfile.InputActionsProfile == null)
            {
                return;
            }

            inputActionRulesDigital        = serializedObject.FindProperty("inputActionRulesDigital");
            inputActionRulesSingleAxis     = serializedObject.FindProperty("inputActionRulesSingleAxis");
            inputActionRulesDualAxis       = serializedObject.FindProperty("inputActionRulesDualAxis");
            inputActionRulesVectorAxis     = serializedObject.FindProperty("inputActionRulesVectorAxis");
            inputActionRulesQuaternionAxis = serializedObject.FindProperty("inputActionRulesQuaternionAxis");
            inputActionRulesPoseAxis       = serializedObject.FindProperty("inputActionRulesPoseAxis");

            baseActionLabels = inputSystemProfile.InputActionsProfile.InputActions
                               .Where(action => action.AxisConstraint != AxisType.None && action.AxisConstraint != AxisType.Raw)
                               .Select(action => action.Description)
                               .ToArray();

            baseActionIds = inputSystemProfile.InputActionsProfile.InputActions
                            .Where(action => action.AxisConstraint != AxisType.None && action.AxisConstraint != AxisType.Raw)
                            .Select(action => (int)action.Id)
                            .ToArray();


            ResetCriteria();
        }
Beispiel #2
0
        protected override void OnEnable()
        {
            base.OnEnable();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured(false) ||
                !MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled ||
                MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile == null)
            {
                return;
            }

            inputActionRulesDigital        = serializedObject.FindProperty("inputActionRulesDigital");
            inputActionRulesSingleAxis     = serializedObject.FindProperty("inputActionRulesSingleAxis");
            inputActionRulesDualAxis       = serializedObject.FindProperty("inputActionRulesDualAxis");
            inputActionRulesVectorAxis     = serializedObject.FindProperty("inputActionRulesVectorAxis");
            inputActionRulesQuaternionAxis = serializedObject.FindProperty("inputActionRulesQuaternionAxis");
            inputActionRulesPoseAxis       = serializedObject.FindProperty("inputActionRulesPoseAxis");

            baseActionLabels = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile.InputActions
                               .Where(action => action.AxisConstraint != AxisType.None && action.AxisConstraint != AxisType.Raw)
                               .Select(action => action.Description)
                               .ToArray();

            baseActionIds = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile.InputActions
                            .Where(action => action.AxisConstraint != AxisType.None && action.AxisConstraint != AxisType.Raw)
                            .Select(action => (int)action.Id)
                            .ToArray();

            thisProfile = target as MixedRealityInputActionRulesProfile;

            ResetCriteria();
        }
Beispiel #3
0
        protected override void OnEnable()
        {
            base.OnEnable();
            isInitialized = false;

            inputActionRulesDigital        = serializedObject.FindProperty("inputActionRulesDigital");
            inputActionRulesSingleAxis     = serializedObject.FindProperty("inputActionRulesSingleAxis");
            inputActionRulesDualAxis       = serializedObject.FindProperty("inputActionRulesDualAxis");
            inputActionRulesVectorAxis     = serializedObject.FindProperty("inputActionRulesVectorAxis");
            inputActionRulesQuaternionAxis = serializedObject.FindProperty("inputActionRulesQuaternionAxis");
            inputActionRulesPoseAxis       = serializedObject.FindProperty("inputActionRulesPoseAxis");

            thisProfile = target as MixedRealityInputActionRulesProfile;

            // Only reset if we haven't get done so
            if (digitalFoldouts == null)
            {
                ResetCriteria();
            }

            if (!MixedRealityToolkit.IsInitialized ||
                !MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled ||
                MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile == null ||
                MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionRulesProfile != thisProfile)
            {
                return;
            }

            var inputActions = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile.InputActions;

            baseActionLabels = inputActions.Where(action => action.AxisConstraint != AxisType.None && action.AxisConstraint != AxisType.Raw)
                               .Select(action => action.Description).ToArray();

            baseActionIds = inputActions.Where(action => action.AxisConstraint != AxisType.None && action.AxisConstraint != AxisType.Raw)
                            .Select(action => (int)action.Id).ToArray();

            isInitialized = true;
        }