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.
		
		
		
		
		
			
		
			
	
	
		
			21 lines
		
	
	
		
			573 B
		
	
	
	
		
			C#
		
	
		
		
			
		
	
	
			21 lines
		
	
	
		
			573 B
		
	
	
	
		
			C#
		
	
| 
								 
											1 year ago
										 
									 | 
							
								using System.Collections;
							 | 
						||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						||
| 
								 | 
							
								using UnityEngine;
							 | 
						||
| 
								 | 
							
								using UnityEngine.XR;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace Autohand.Demo{
							 | 
						||
| 
								 | 
							
								public class XRHeadTracking : MonoBehaviour{
							 | 
						||
| 
								 | 
							
								#if UNITY_2020_3_OR_NEWER
							 | 
						||
| 
								 | 
							
								        public TrackingOriginModeFlags mode = TrackingOriginModeFlags.TrackingReference;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    void Start(){
							 | 
						||
| 
								 | 
							
								        List<XRInputSubsystem> subsystems = new List<XRInputSubsystem>();
							 | 
						||
| 
								 | 
							
								        SubsystemManager.GetSubsystems(subsystems);
							 | 
						||
| 
								 | 
							
								        for(int i = 0;  i < subsystems.Count; i++){
							 | 
						||
| 
								 | 
							
								            subsystems[i].TrySetTrackingOriginMode(mode);
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |