You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			27 lines
		
	
	
		
			771 B
		
	
	
	
		
			C#
		
	
		
		
			
		
	
	
			27 lines
		
	
	
		
			771 B
		
	
	
	
		
			C#
		
	
| 
								 
											1 year ago
										 
									 | 
							
								#if UNITY_STANDALONE_WIN || UNITY_EDITOR
							 | 
						||
| 
								 | 
							
								using System.Collections;
							 | 
						||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						||
| 
								 | 
							
								using UnityEngine;
							 | 
						||
| 
								 | 
							
								using Valve.VR;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace Autohand.Demo{
							 | 
						||
| 
								 | 
							
								    public class SteamVRTeleporterLink : MonoBehaviour{
							 | 
						||
| 
								 | 
							
								        public Teleporter teleport;
							 | 
						||
| 
								 | 
							
								        public SteamVR_Input_Sources handType;
							 | 
						||
| 
								 | 
							
								        public SteamVR_Action_Boolean teleportAction;
							 | 
						||
| 
								 | 
							
								        bool teleporting;
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        private void FixedUpdate() {
							 | 
						||
| 
								 | 
							
								            if(!teleporting && teleportAction.GetState(handType)){
							 | 
						||
| 
								 | 
							
								                teleporting = true;
							 | 
						||
| 
								 | 
							
								                teleport.StartTeleport();
							 | 
						||
| 
								 | 
							
								            }
							 | 
						||
| 
								 | 
							
								            else if(teleporting && !teleportAction.GetState(handType)){
							 | 
						||
| 
								 | 
							
								                teleporting = false;
							 | 
						||
| 
								 | 
							
								                teleport.Teleport();
							 | 
						||
| 
								 | 
							
								            }
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 |