예제 #1
0
        private void OnGrabStartVoid(
            object sender,
            ObjectInteraction.InteractableObjectEventArgs interactableObjectEventArgs)
        {
            if (Settings.Instance().Multiplayer)
            {
                ChangeOwner();
                ObjectController.photonView.RPC("OnGrabStartRpc", PhotonTargets.All);
            }
            else
            {
                GrabingContext context = new GrabingContext {
                    GameObject = Vio.GetGrabbingObject(), Hand = interactableObjectEventArgs.Hand
                };

                foreach (IGrabStartAware startAware in _grabStartList)
                {
                    startAware?.OnGrabStart(context);
                }

                if (_grabPoint == null)
                {
                    return;
                }

                //Fixed joint grab attach in progress...

                /*Transform grabPosition =
                 *  context.GameObject.name.Contains("Left") ?
                 *      _grabPoint.GetLeftGrabPoint() :
                 *      _grabPoint.GetRightGrabPoint();
                 *
                 * PlayerController.PlayerNodes.ControllerNode handNode = context.GameObject.name.Contains("Left") ?
                 *  InputAdapter.Instance.PlayerController.Nodes.LeftHand :
                 *  InputAdapter.Instance.PlayerController.Nodes.RightHand;
                 *
                 * _gameObject.AddComponent<GrabPointJoint>().Init(handNode, grabPosition);*/
            }
        }