Пример #1
0
        protected override void EnableEditorInput()
        {
            if (!IsRootGameObject)
            {
                return;
            }

            Vio.isGrabbable = true;

            PlayerAppearance.InteractControllerAppearance grab =
                InputAdapter.Instance.PlayerAppearance.ControllerAppearance.GetFrom(GameObject)
                ?? InputAdapter.Instance.PlayerAppearance.ControllerAppearance.AddTo(GameObject);

            grab.HideControllerOnGrab = true;

            Vio.SwapControllersFlag = true;

            Vio.grabOverrideButton           = ControllerInput.ButtonAlias.GripPress;
            Vio.InteractableObjectGrabbed   += EditorGrabbed;
            Vio.InteractableObjectUngrabbed += EditorUngrabbed;

            JointBehaviour jointBehaviour = GameObject.GetComponent <JointBehaviour>();

            if (jointBehaviour != null)
            {
                _onEditorGrabStart += jointBehaviour.OnGrabStart;
                _onEditorGrabEnd   += jointBehaviour.OnGrabEnd;
            }
        }
Пример #2
0
        private void InitGrabAction()
        {
            Vio.isGrabbable = true;

            PlayerAppearance.InteractControllerAppearance grab =
                InputAdapter.Instance.PlayerAppearance.ControllerAppearance.GetFrom(GameObject) ??
                InputAdapter.Instance.PlayerAppearance.ControllerAppearance.AddTo(GameObject);

            grab.HideControllerOnGrab = true;

            Vio.SwapControllersFlag = true;
        }