Beispiel #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();
    }
        /// <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);
            }
        }
Beispiel #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");
            }
        }
Beispiel #4
0
 // Use this for initialization
 protected virtual void Start()
 {
     camera = FindObjectOfType <MixedRealityCameraManager>();
     cursor = FindObjectOfType <HoloToolkit.Unity.InputModule.Cursor>();
     input  = FindObjectOfType <InputManager>();
 }
Beispiel #5
0
 // 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>();
 }
Beispiel #6
0
    /*<<------------------Singleton-----------------------*/

    private void Start()
    {
        activeFeedback    = scaleFeedback;
        cursor            = InputManager.Instance.gameObject.GetComponent <SimpleSinglePointerSelector>().Cursor;
        sortColorRenderer = sortColorFeedback.GetComponent <Renderer>();
    }
Beispiel #7
0
 private void Awake()
 {
     cursor = GetComponent <HoloToolkit.Unity.InputModule.Cursor>();
 }