// Retract tentacle private void OnTriggerEnter(Collider collider) { if (!extendedAtLeastOnce) { return; } audioSource = GetComponent <AudioSource>(); AudioClip retractSound = retractSounds[Random.Range(0, retractSounds.Length)]; audioSource.PlayOneShot(retractSound); Tentacle tentacle = getTentacle(collider); if (tentacle != null) { print("GestureTrigger TriggerEnter retracting " + collider.name); tentacle.OnPlayerShrinkMortion(); } }
// Update is called once per frame void Update() { // For testing without a VR system if (Input.GetKeyDown("1")) { leftTentacle.OnPlayerStretchMortion(vrSimulatorLeftHand.transform, vrSimulatorRightHand.transform.forward); } if (Input.GetKeyDown("2")) { leftTentacle.OnPlayerShrinkMortion(); } if (Input.GetKeyDown("3")) { rightTentacle.OnPlayerStretchMortion(vrSimulatorRightHand.transform, vrSimulatorRightHand.transform.forward); } if (Input.GetKeyDown("4")) { rightTentacle.OnPlayerShrinkMortion(); } }