Exemplo n.º 1
0
        private bool HasDeviceSpecificGesturesEnabled(AppIntentProfile profile)
        {
            for (int i = 0; i < WearableConstants.GestureIds.Length; i++)
            {
                GestureId id = WearableConstants.GestureIds[i];

                if (id == GestureId.None)
                {
                    continue;
                }

                if (profile.GetGestureInProfile(id) && id.IsGestureDeviceSpecific())
                {
                    return(true);
                }
            }

            return(false);
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            GestureId gestureId         = (GestureId)_gestureId.intValue;
            bool      isGestureSelected = gestureId != (int)GestureId.None;

            EditorGUILayout.PropertyField(_gestureId, WearableEditorConstants.EMPTY_LAYOUT_OPTIONS);

            if (!isGestureSelected)
            {
                EditorGUILayout.HelpBox(GESTURE_SELECT_MESSAGE, MessageType.Warning);
            }
            else if (gestureId.IsGestureDeviceSpecific())
            {
                EditorGUILayout.HelpBox(WearableEditorConstants.DEVICE_SPECIFIC_GESTURE_DISCOURAGED_WARNING, MessageType.Warning);
            }

            EditorGUILayout.PropertyField(_gestureEvent, WearableEditorConstants.EMPTY_LAYOUT_OPTIONS);

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            GestureId gestureId         = (GestureId)_gestureId.intValue;
            bool      isGestureSelected = gestureId != (int)GestureId.None;

            EditorGUILayout.PropertyField(_gestureId, WearableConstants.EmptyLayoutOptions);

            if (!isGestureSelected)
            {
                EditorGUILayout.HelpBox(GestureSelectMessage, MessageType.Warning);
            }
            else if (gestureId.IsGestureDeviceSpecific())
            {
                EditorGUILayout.HelpBox(WearableConstants.DeviceSpecificGestureDiscouragedWarning, MessageType.Warning);
            }

            EditorGUILayout.PropertyField(_gestureEvent, WearableConstants.EmptyLayoutOptions);

            serializedObject.ApplyModifiedProperties();
        }