Beispiel #1
0
        protected virtual void Start()
        {
            // Make sure the Tagalong object has a BoxCollider.
            tagalongCollider = GetComponent <BoxCollider>();

            // Get the Interpolator component and set some default parameters for
            // it. These parameters can be adjusted in Unity's Inspector as well.
            interpolator = gameObject.GetComponent <Interpolator>();
            interpolator.SmoothLerpToTarget      = SmoothMotion;
            interpolator.SmoothPositionLerpRatio = SmoothingFactor;
        }
Beispiel #2
0
        public void ToggleManipulating()
        {
            Debug.Log("ToggleManipulation");

            placing = false;
            GazeManager.Instance.IsDisabled = !GazeManager.Instance.IsDisabled;
            manipulating = !manipulating;
            if (manipulating)
            {
                targetInterpolator    = gameObject.GetComponent <Interpolator>();
                initialHandPosition   = Camera.main.transform.InverseTransformPoint(GestureManager.Instance.ManipulationHandPosition);
                initialObjectPosition = Camera.main.transform.InverseTransformPoint(transform.position);
            }
        }