Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (RayFromCamera.ObjectLookAt() != null && teleport.CanTeleport)
        {
            //Debug.Log(Pose.GetLocalPosition(HandType).y + "  " + Pose.GetVelocity(HandType).y);
            GameObject obj = RayFromCamera.ObjectLookAt();
            //if (Pose.GetLocalPosition(HandType).y <= teleport.heightRequired &&
            //    (Pose.GetLastLocalPosition(HandType).y - Pose.GetLocalPosition(HandType).y) > 0 &&

            //    (Pose.GetLastVelocity(HandType).y - Pose.GetVelocity(HandType).y) > 0 &&
            //    Pose.GetVelocity(HandType).y <= teleport.speedRequired)

            //if((Pose.GetVelocity(HandType).y > 1 && Pose.GetLocalPosition(HandType).y > 0.1f) || Trigger.GetStateDown(SteamVR_Input_Sources.Any))



            if (Pose.GetLocalPosition(HandType).y <= teleport.heightRequired &&
                (Pose.GetLastLocalPosition(HandType).y - Pose.GetLocalPosition(HandType).y) > 0 &&
                (Pose.GetLastVelocity(HandType).y - Pose.GetVelocity(HandType).y) > 0 &&
                Pose.GetVelocity(HandType).y <= teleport.speedRequired)
            {
                teleport.Begin(obj);
                teleport.CanTeleport = false;
            }
        }

        //ShowTargetObject();
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     if (GameObject.FindGameObjectWithTag("Rope") == null && RayFromCamera.ObjectLookAt() != null && Trigger.GetStateDown(HandType))
     {
         GameObject wire       = Instantiate(wirePrefab, camera.transform.position, Quaternion.identity);
         WireAction wireAction = wire.GetComponentInChildren <WireAction>();
         wireAction.Initialize(RayFromCamera.ObjectLookAt(), camera.transform.position);
     }
 }
Esempio n. 3
0
 private void Awake()
 {
     input = FindObjectOfType <InputManager>();
     Assert.IsNotNull(input, "InputManager not found.");
     nonPlayerTrigger = GetComponentInChildren <NonPlayerTrigger>();
     Assert.IsNotNull(input, "NonPlayerTrigger not found.");
     ray      = GetComponent <RayFromCamera>();
     player   = GetComponent <PlayerMovement>();
     rewinder = GetComponent <Rewinder>();
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (RayFromCamera.ObjectLookAt() == this.gameObject)
     {
         material.SetColor("_TintColor", hitColor);
     }
     else
     {
         material.SetColor("_TintColor", normalColor);
     }
 }
Esempio n. 5
0
    private void Awake()
    {
        input = FindObjectOfType <InputManager>();
        Assert.IsNotNull(input, "InputManager not found.");
        timeManager = FindObjectOfType <TimeManager>();
        Assert.IsNotNull(input, "TimeManager not found.");

        ray     = GetComponent <RayFromCamera>();
        player  = GetComponent <RewindablePlayer>();
        carrier = GetComponent <Carrier>();

        VolumeProfile volumeProfile = Camera.main.GetComponent <Volume>().profile;

        volumeProfile.TryGet <ChromaticAberration>(out chromaticAberration);
        rewindCountdownText = rewindCountdown.GetComponentInChildren <TextMeshProUGUI>();
    }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        if (RayFromCamera.ObjectLookAt() != null && teleport.CanTeleport)
        {
            GameObject obj = RayFromCamera.ObjectLookAt();

            if (defaultPos - transform.position.y >= moveRequired)
            {
                teleport.Begin(obj);
                teleport.CanTeleport = false;
            }
        }

        if (trigger.GetStateDown(SteamVR_Input_Sources.Any))
        {
            defaultPos = transform.position.y;
            Debug.Log("aaa");
        }
    }
Esempio n. 7
0
 void Awake()
 {
     input = FindObjectOfType <InputManager>();
     Assert.IsNotNull(input, "InputManager not found.");
     ray = GetComponent <RayFromCamera>();
 }