void Start() { GameObject rs = GameObject.Find("RealityServer"); if (rs != null) { Viewport = rs.GetComponent <UnityViewport> (); if (Viewport == null) { Debug.Log("- object drag component needs a UnityViewport component to work with."); this.enabled = false; return; } if (Viewport.enabled == false) { Debug.Log("- object drag component needs a UnityViewport that is enabled to work with."); this.enabled = false; return; } } else { Debug.Log("- object drag requires RealityServer"); this.enabled = false; return; } Camera cam = Viewport.RenderCamera; if (cam != null) { NavigationScript = cam.GetComponent <CameraNavigation> (); if (NavigationScript == null) { Debug.Log("- object drag requires CameraNavigation"); this.enabled = false; return; } } else { Debug.Log("- object drag requires Main Camera"); this.enabled = false; return; } Moved = false; Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting); }
void Start () { GameObject rs = GameObject.Find ("RealityServer"); if (rs != null) { Viewport = rs.GetComponent<UnityViewport> (); if (Viewport == null) { Debug.Log ("- object drag component needs a UnityViewport component to work with."); this.enabled = false; return; } if (Viewport.enabled == false) { Debug.Log ("- object drag component needs a UnityViewport that is enabled to work with."); this.enabled = false; return; } } else { Debug.Log ("- object drag requires RealityServer"); this.enabled = false; return; } Camera cam = Viewport.RenderCamera; if (cam != null) { NavigationScript = cam.GetComponent<CameraNavigation> (); if (NavigationScript == null) { Debug.Log ("- object drag requires CameraNavigation"); this.enabled = false; return; } } else { Debug.Log ("- object drag requires Main Camera"); this.enabled = false; return; } Moved = false; Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting); }