예제 #1
0
        public override void OnNodeGUI()
        {
            GUILayout.Space(EditorGUIUtility.singleLineHeight * 2 + 4);
            outputTexture = EditorGUILayout.ObjectField(outputTexture, typeof(Texture2D), false) as Texture2D;
            EditorGUI.BeginChangeCheck();
            {
                if ((isMaterialOutput = EditorGUILayout.Toggle("material output", isMaterialOutput)))
                {
                    if (outputMaterial == null)
                    {
                        CreateNewMaterial();
                    }
                    tiling = EditorGUILayout.Vector2Field("tiling", tiling);
                    offset = EditorGUILayout.Vector2Field("offset", offset);

                    UpdateMaterialProperties();

                    if ((preview = EditorGUILayout.Foldout(preview, "preview")))
                    {
                        matPreview.Render(outputMaterial);
                    }
                }
                else if (outputTexture != null)
                {
                    if ((preview = EditorGUILayout.Foldout(preview, "preview")))
                    {
                        PWGUI.TexturePreview(outputTexture);
                    }
                }
            }
            if (EditorGUI.EndChangeCheck())
            {
                UpdateProps();
            }
        }
		public override void OnNodeGUI()
		{
			GUILayout.Space(EditorGUIUtility.singleLineHeight);
			outputTexture = EditorGUILayout.ObjectField(outputTexture, typeof(Texture2D), false) as Texture2D;
			EditorGUI.BeginChangeCheck();
			{
				if ((isMaterialOutput = EditorGUILayout.Toggle("material output", isMaterialOutput)))
				{
					if (outputMaterial == null)
						CreateNewMaterial();
					tiling = EditorGUILayout.Vector2Field("tiling", tiling);
					offset = EditorGUILayout.Vector2Field("offset", offset);
	
					UpdateMaterialProperties();
					
					EditorGUI.BeginChangeCheck();
					showSceneHiddenObjects = EditorGUILayout.Toggle("Show scene hidden objects", showSceneHiddenObjects);
					if (EditorGUI.EndChangeCheck())
						matPreview.UpdateShowSceneHiddenObjects(showSceneHiddenObjects);
					
					if ((preview = EditorGUILayout.Foldout(preview, "preview")))
						matPreview.Render();
				}
				else if (outputTexture != null)
					if ((preview = EditorGUILayout.Foldout(preview, "preview")))
						PWGUI.TexturePreview(outputTexture);
			}
			if (EditorGUI.EndChangeCheck())
				UpdateProps();
		}
예제 #3
0
        public override void OnNodeGUI()
        {
            GUILayout.Space(EditorGUIUtility.singleLineHeight);

            outputMaterial = EditorGUILayout.ObjectField(outputMaterial, typeof(Material), false) as Material;

            if ((showPreview = EditorGUILayout.Foldout(showPreview, "preview")))
            {
                matPreview.Render(outputMaterial);
            }
        }
        public override void OnNodeGUI()
        {
            GUILayout.Space(EditorGUIUtility.singleLineHeight);

            EditorGUI.BeginChangeCheck();
            outputMaterial = EditorGUILayout.ObjectField(outputMaterial, typeof(Material), false) as Material;
            if (EditorGUI.EndChangeCheck())
            {
                matPreview.SetMaterial(outputMaterial);
            }

            EditorGUI.BeginChangeCheck();
            showSceneHiddenObjects = EditorGUILayout.Toggle("Show scene hidden objects", showSceneHiddenObjects);
            if (EditorGUI.EndChangeCheck())
            {
                matPreview.UpdateShowSceneHiddenObjects(showSceneHiddenObjects);
            }

            if ((showPreview = EditorGUILayout.Foldout(showPreview, "preview")))
            {
                matPreview.Render();
            }
        }