Пример #1
0
        public override void StartUsing(VRTK_InteractUse usingObject)
        {
            base.StartUsing(usingObject);

            if (shape == PrimitiveTypes.Cube)
            {
                teleporter.ForceTeleport(GameObject.Find("Floor").transform, new Vector3(4f, 0.5f, 4f));
            }
            else if (shape == PrimitiveTypes.Sphere)
            {
                teleporter.ForceTeleport(GameObject.Find("Floor").transform, new Vector3(-2f, 0.5f, -2f));
            }
            ResetMenuItems();
        }
Пример #2
0
        public GameObject teleportTo;         //What I added


        public override void StartUsing(VRTK_InteractUse usingObject)
        {
            base.StartUsing(usingObject);

            if (shape == PrimitiveTypes.Cube)
            {
                teleporter.ForceTeleport(teleportTo.transform.position);                 //What I added

                //CreateShape(PrimitiveType.Cube, selectedColor); //Kept what was originally there just in case
            }

            else if (shape == PrimitiveTypes.Sphere)
            {
                teleporter.ForceTeleport(teleportTo.transform.position);                 //What I added

                //CreateShape(PrimitiveType.Sphere, selectedColor); //Kept what was originally there just in case
            }
            ResetMenuItems();
        }
Пример #3
0
    private void HandleResetHit()
    {
        // get start object
        GameObject startObject = GameObject.Find(playerController.GetCurrentCheckpoint());

        Debug.Log(playerController.GetCurrentCheckpoint());

        // get start location
        Vector3 startLocation = startObject.transform.position;

        // teleport to start location
        //playAreaTransform.position = startLocation;
        VRTK_BasicTeleport basicTPScript = this.GetComponent <VRTK_BasicTeleport>();

        basicTPScript.ForceTeleport(startLocation);
    }
Пример #4
0
    //private void DoTriggerClicked(object sender, ControllerInteractionEventArgs e)
    //{
    //    Debug.Log("Trigger clicked");
    //    FireProjectile();
    //}

    protected virtual void InteractableObjectUsed(object sender, InteractableObjectEventArgs e)
    {
        if (GameObject.Find(projectile.name + "(Clone)") == null)
        {
            FireProjectile();
        }
        else
        {
            //lerp scale camera view object
            Transform cameraPlane = GameObject.FindGameObjectWithTag("CameraPlane").transform;
            Debug.Log(string.Format("Camera Plane Object is {0}", cameraPlane));
            //LerpUp(cameraPlane);
            var destination = GameObject.Find(projectile.name + "(Clone)");
            //Debug.Log(string.Format("Destination is {0}", destination));
            teleporter.ForceTeleport(destination.transform.position, null);
            Destroy(destination);
        }
    }
Пример #5
0
 private void OnEgyptClick(PointerEventData eventData)
 {
     basicTele.ForceTeleport(FindTF(points, "EgyptPoint").position, Quaternion.Euler(Vector3.zero));
 }
Пример #6
0
 /// <summary>
 /// Move player to given transform, get position and rotation from the transform.
 /// </summary>
 /// <param name="targetLocation">position and rotation</param>
 public void MovePlayer(Transform targetLocation)
 {
     VRTK_BasicTeleport.ForceTeleport(targetLocation.position, targetLocation.rotation);
 }
Пример #7
0
 public override void FinishGame()
 {
     _onFinish.Invoke();
     teleporter.ForceTeleport(position.position, position.rotation);
 }