Beispiel #1
0
    void OnManipulation(ManipulationEventData data)
    {
        if (FindObjectOfType <WarpzoneManager>().ActiveWarpzone != null)
        {
            var obj = PhotonNetwork.Instantiate(Path.Combine("OOI", "Spawnable", Object.name), transform.position, transform.rotation,
                                                (byte)TargetManager.Groups.PLAYERS);
            obj.transform.parent     = _virtualCity.transform;
            obj.transform.localScale = transform.lossyScale;

            var pointer     = data.Pointer as SpherePointer;
            var inputAction = pointer.PoseAction;
            var handedness  = pointer.Handedness;
            StartCoroutine(EndManipulation());
            IEnumerator EndManipulation()
            {
                yield return(null);

                _manipulator.ForceEndManipulation();
                _manipulator.enabled = false;
                _manipulator.GetComponent <Collider>().enabled = false;
                pointer.IsFocusLocked = false;
                yield return(null);

                _inputSystem.RaisePointerDown(pointer, inputAction, handedness);
                _manipulator.enabled = true;
                _manipulator.GetComponent <Collider>().enabled = true;
            }
        }
    }