コード例 #1
0
    private void Awake()
    {
        _isSliderManipulationTriggered = false;
        foreach (Transform child in transform)
        {
            if (child.CompareTag("SliderButton"))
            {
                _button = child.gameObject;
            }
            else if (child.CompareTag("SliderName"))
            {
                child.GetComponent <TextMesh>().text = SliderName;
            }
        }

        _cursor = GameObject.FindGameObjectWithTag("HoloCursor").GetComponent <Cursor>();

        if (!_cursor)
        {
            Debug.LogWarning("No Cursor with Tag 'HoloCursor' present in scene.");
        }

        _sliderRange = MaximumValue - MinimumValue;

        _button.GetComponent <Renderer>().material.color = _buttonColorOffFocus;
        UpdatePosition();
    }
コード例 #2
0
        /// <summary>
        /// Hide the cursor during the gesture
        /// </summary>
        /// <param name="state"></param>
        private void HandleCursor(bool state)
        {
            // Hack for now.
            // TODO: Update Cursor Modifier to handle HideOnGesture, then calculate visibility so cursors can handle this correctly
            if (state)
            {
                mCursor = FindObjectOfType <Cursor>();
            }

            if (HideCursorOnManipulation && mCursor != null)
            {
                mCursor.SetVisiblity(!state);
            }
        }
コード例 #3
0
        void Awake()
        {
            if (movable)
            {
                HandDraggable dragComp = gameObject.AddComponent <HandDraggable>();
                dragComp.StartedDragging  += StartDrag;
                dragComp.StoppedDragging  += StopDrag;
                dragComp.RotationMode      = rotationMode;
                dragComp.IsDraggingEnabled = true;

                HoloToolkit.Unity.InputModule.Cursor c = FindObjectOfType <HoloToolkit.Unity.InputModule.Cursor>();
                dragComp.hackedCursorReference = c.transform;

                WorldErrors.Print("Created Hand-draggable");
            }
        }
コード例 #4
0
 // Use this for initialization
 protected virtual void Start()
 {
     camera = FindObjectOfType <MixedRealityCameraManager>();
     cursor = FindObjectOfType <HoloToolkit.Unity.InputModule.Cursor>();
     input  = FindObjectOfType <InputManager>();
 }
コード例 #5
0
ファイル: PixelClickHandler.cs プロジェクト: mrcdnk/dicomholo
 // Start is called before the first frame update
 private void Start()
 {
     _cursor        = GameObject.FindGameObjectWithTag("HoloCursor").GetComponent <Cursor>();
     _mainCamera    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
     _rectTransform = GetComponent <RectTransform>();
 }
コード例 #6
0
    /*<<------------------Singleton-----------------------*/

    private void Start()
    {
        activeFeedback    = scaleFeedback;
        cursor            = InputManager.Instance.gameObject.GetComponent <SimpleSinglePointerSelector>().Cursor;
        sortColorRenderer = sortColorFeedback.GetComponent <Renderer>();
    }
コード例 #7
0
ファイル: CursorFeedback.cs プロジェクト: mannycarr214/SUITS
 private void Awake()
 {
     cursor = GetComponent <HoloToolkit.Unity.InputModule.Cursor>();
 }