コード例 #1
0
        void Start()
        {
            Viewport = GetComponent <UnityViewport>();
            if (Viewport == null)
            {
                Logger.Log("error", "Ground shadows component needs a UnityViewport component to work with.");
                this.enabled = false;
                return;
            }
            if (Viewport.enabled == false)
            {
                Logger.Log("error", "Ground shadows component needs a UnityViewport that is enabled to work with.");
                this.enabled = false;
                return;
            }
            Enabled = true;
            Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);

            OldGroundHeight = GroundHeight + 1.0f;
            OldAutoCalculateGroundHeight = !AutoCalculateGroundHeight;
            OldSceneYUp = !Viewport.SceneYUp;
        }
コード例 #2
0
 void Start()
 {
     Viewport = GetComponent<UnityViewport>();
     if (Viewport == null)
     {
         Debug.Log("- Iray background colour component needs a UnityViewport component to work with.");
         this.enabled = false;
         return;
     }
     if (Viewport.enabled == false)
     {
         Debug.Log("- Iray background colour component needs a UnityViewport that is enabled to work with.");
         this.enabled = false;
         return;
     }
     Enabled = this.enabled;
     Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);
     
     Color temp = Colour;
     temp.a = temp.a > 0.0f ? 0.0f : 1.0f;
     OldColour = temp;
 }
コード例 #3
0
ファイル: Drag.cs プロジェクト: pranaykamat/rs-unity
		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);
		}
コード例 #4
0
ファイル: GroundShadows.cs プロジェクト: pranaykamat/rs-unity
        void Start()
        {
            Viewport = GetComponent<UnityViewport>();
            if (Viewport == null)
            {
                Debug.Log("- Ground shadows component needs a UnityViewport component to work with.");
                this.enabled = false;
                return;
            }
            if (Viewport.enabled == false)
            {
                Debug.Log("- Ground shadows component needs a UnityViewport that is enabled to work with.");
                this.enabled = false;
                return;
            }
            Enabled = true;
            Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);

            OldGroundHeight = GroundHeight + 1.0f;
            OldAutoCalculateGroundHeight = !AutoCalculateGroundHeight;
            OldSceneYUp = !Viewport.SceneYUp;
        }
コード例 #5
0
        void Start()
        {
            Viewport = GetComponent <UnityViewport>();
            if (Viewport == null)
            {
                Debug.Log("- Iray background colour component needs a UnityViewport component to work with.");
                this.enabled = false;
                return;
            }
            if (Viewport.enabled == false)
            {
                Debug.Log("- Iray background colour component needs a UnityViewport that is enabled to work with.");
                this.enabled = false;
                return;
            }
            Enabled = this.enabled;
            Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);

            Color temp = Colour;

            temp.a    = temp.a > 0.0f ? 0.0f : 1.0f;
            OldColour = temp;
        }