示例#1
0
        /// <summary>
        /// Check editor set variables for null references.
        /// </summary>
        void Awake()
        {
            if (_numberOfPlanesText == null)
            {
                Debug.LogError("Error PlanesExample._numberOfPlanesText is not set, disabling script.");
                enabled = false;
                return;
            }
            if (_boundedExtentsText == null)
            {
                Debug.LogError("Error PlanesExample._boundedExtentsText is not set, disabling script.");
                enabled = false;
                return;
            }
            if (_boundsWireframeCube == null)
            {
                Debug.LogError("Error PlanesExample._boundsWireframeCube is not set, disabling script.");
                enabled = false;
                return;
            }
            MLResult result = MLInput.Start();

            if (!result.IsOk)
            {
                Debug.LogError("Error PlanesExample starting MLInput, disabling script.");
                enabled = false;
                return;
            }

            MLInput.OnControllerButtonDown += OnButtonDown;

            _planesComponent = GetComponent <Planes>();
            _camera          = Camera.main;
        }
示例#2
0
        void Awake()
        {
            MagicLeapDevice.RegisterOnHeadTrackingMapEvent(OnHeadTrackingMapEvent);

            _planesComponent  = GetComponent <Planes>();
            _planesVisualizer = GetComponent <PlaneVisualizer>();

            _camera = Camera.main;
        }
示例#3
0
        /// <summary>
        /// Initializes variables.
        /// </summary>
        void Start()
        {
            if (!MLInput.Start())
            {
                Debug.LogError("Error PlanesExample starting MLInput, disabling script.");
                enabled = false;
                return;
            }
            _controller = MLInput.GetController(MLInput.Hand.Left);

            _planesComponent = GetComponent <Planes>();
        }
        /// <summary>
        /// Check editor set variables for null references.
        /// </summary>
        void Awake()
        {
            if (_numberOfPlanesText == null)
            {
                Debug.LogError("Error: PlanesExample._numberOfPlanesText is not set, disabling script.");
                enabled = false;
                return;
            }

            if (_numberOfBoundariesText == null)
            {
                Debug.LogError("Error: PlanesExample._numberOfBoundariesText is not set, disabling script.");
                enabled = false;
                return;
            }

            if (_boundedExtentsText == null)
            {
                Debug.LogError("Error: PlanesExample._boundedExtentsText is not set, disabling script.");
                enabled = false;
                return;
            }

            if (_boundsWireframeCube == null)
            {
                Debug.LogError("Error: PlanesExample._boundsWireframeCube is not set, disabling script.");
                enabled = false;
                return;
            }

            if (_controllerConnectionHandler == null)
            {
                Debug.LogError("Error: PlanesExample._controllerConnectionHandler is not set, disabling script.");
                enabled = false;
                return;
            }

            MLInput.OnControllerButtonDown += OnButtonDown;
            MagicLeapDevice.RegisterOnHeadTrackingMapEvent(OnHeadTrackingMapEvent);

            _planesComponent = GetComponent <Planes>();
            _camera          = Camera.main;
        }