This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gql from 'graphql-tag'; | |
| import { PropTypes } from 'prop-types'; | |
| import React from 'react'; | |
| import { Mutation } from 'react-apollo'; | |
| const DecrementView = ({ onDecrement }) => ( | |
| <button onClick={onDecrement}>-</button> | |
| ); | |
| DecrementView.propTypes = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| counter: 0, | |
| todos: [], | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default ` | |
| type Todo { | |
| id: Int! | |
| text: String! | |
| completed: Boolean! | |
| } | |
| type Query { | |
| counter: Int | |
| todos: [Todo] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gql from 'graphql-tag'; | |
| const query = gql` | |
| { | |
| counter @client | |
| } | |
| `; | |
| let nextTodoId = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| const Todo = ({ completed, id, text }) => ( | |
| <Mutation mutation={TOGGLE_TODO} variables={{ id }}> | |
| {toggleTodo => ( | |
| <TodoView | |
| completed={completed} | |
| text={text} | |
| onClick={toggleTodo} | |
| /> | |
| )} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.Experimental.XR.MagicLeap; | |
| public class Cube : MonoBehaviour | |
| { | |
| private static int BUTTON_ACTIVE = 1; | |
| private static int BUTTON_INACTIVE = 0; | |
| private static Color BUTTON_ACTIVE_COLOR = Color.blue; | |
| private static Color BUTTON_INACTIVE_COLOR = Color.white; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.UI; | |
| using UnityEngine.Experimental.XR.MagicLeap; | |
| public class Gesture : MonoBehaviour | |
| { | |
| private static float GESTURE_CONFIDENCE_THRESHOLD = 0.5f; | |
| private static Color COLOR_BOTH = Color.magenta; | |
| private static Color COLOR_LEFT = Color.red; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.Experimental.XR.MagicLeap; | |
| public class Planes : MonoBehaviour { | |
| private static uint MAX_RESULTS = 100; | |
| public Transform BBoxTransform; | |
| public Vector3 BBoxExtents; | |
| public GameObject prefab; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.Experimental.XR.MagicLeap; | |
| public class Raycast : MonoBehaviour { | |
| static Vector3 POSITION = new Vector3(0.0f, 0.5f, 0.0f); | |
| static Vector3 DIRECTION = new Vector3(-1.0f, 0.0f, 0.0f); | |
| public GameObject prefab; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using UnityEngine; | |
| using UnityEngine.Experimental.XR.MagicLeap; | |
| public class Ball : MonoBehaviour { | |
| // HANDS | |
| static MLHandKeyPose H_KEYPOSE = MLHandKeyPose.Fist; | |
| static float H_KEYPOSE_CONFIDENCE_THRESHOLD = 0.5f; |