Esempio n. 1
0
 private void Start()
 {
     // Find the first VLHoloLensTrackerBeavhiour, if it wasn't specified
     // explicitly
     if (this.holoLensTrackerBehaviour == null)
     {
         // Automatically find VLHoloLensTrackerBehaviour
         this.holoLensTrackerBehaviour =
             FindObjectOfType <VLHoloLensTrackerBehaviour>();
         if (this.holoLensTrackerBehaviour == null)
         {
             Debug.LogWarning("[vlUnitySDK] No GameObject with VLHoloLensTrackerBehaviour found");
         }
     }
 }
Esempio n. 2
0
 private void Start()
 {
     // Automatically find VLHoloLensTrackerBehaviour, if it wasn't
     // specified explicitly
     if (this.holoLensTrackerBehaviour == null)
     {
         // Try to find it on the same GameObject
         this.holoLensTrackerBehaviour =
             GetComponent <VLHoloLensTrackerBehaviour>();
         if (this.holoLensTrackerBehaviour == null)
         {
             // Try to find it anywhere in the scene
             this.holoLensTrackerBehaviour =
                 FindObjectOfType <VLHoloLensTrackerBehaviour>();
             if (this.holoLensTrackerBehaviour == null)
             {
                 Debug.LogWarning("[vlUnitySDK] No GameObject with VLHoloLensTrackerBehaviour found");
             }
         }
     }
 }
Esempio n. 3
0
    /// <summary>
    /// Finds the "content" node of the HoloLensTrackerBehaviour. Under
    /// HoloLens this is relevant for calculating the correct (relative)
    /// transform for Models which should be added to the vlSDK.
    /// </summary>
    /// <returns></returns>
    private Transform getContentTransform()
    {
        // VLHoloLensTrackerBehaviour specified explicitly?
        if (this.holoLensTrackerBehaviour != null)
        {
            return(this.holoLensTrackerBehaviour.content.transform);
        }

        // Look for it at the same GameObject first
        this.holoLensTrackerBehaviour =
            GetComponent <VLHoloLensTrackerBehaviour>();
        if (this.holoLensTrackerBehaviour != null)
        {
            return(this.holoLensTrackerBehaviour.content.transform);
        }

        // Try to find it anywhere in the scene
        this.holoLensTrackerBehaviour = FindObjectOfType <VLHoloLensTrackerBehaviour>();
        if (this.holoLensTrackerBehaviour != null)
        {
            return(this.holoLensTrackerBehaviour.content.transform);;
        }
        return(null);
    }