protected internal override void InspectorNodeGUI() { m_OffsetX = RTEditorGUI.Slider(m_OffsetX, -1000.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R); m_OffsetY = RTEditorGUI.Slider(m_OffsetY, -1000.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R); m_ScaleX = RTEditorGUI.Slider(m_ScaleX, 0.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R); m_ScaleY = RTEditorGUI.Slider(m_ScaleY, 0.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R); m_Noise = RTEditorGUI.Slider(m_Noise, 0.0f, 1000.0f); //,new GUIContent("Red", "Float"), m_R); m_Octaves = RTEditorGUI.IntSlider(m_Octaves, 0, 10); //,new GUIContent("Red", "Float"), m_R); if (m_Cached != null) { GUILayout.Label(m_Cached); } /* * GUILayout.Label ("This is a custom Node!"); * * GUILayout.BeginHorizontal (); * GUILayout.BeginVertical (); * * * * GUILayout.EndVertical (); * GUILayout.BeginVertical (); * * Outputs [0].DisplayLayout (); * * GUILayout.EndVertical (); * GUILayout.EndHorizontal (); * */ }
public override void NodeGUI() { inputTexKnob.SetPosition(20); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); ip = RTEditorGUI.TextField(new GUIContent("IP"), ip); if (GUILayout.Button("Set IP")) { controller.remoteIP = ip; } GUILayout.EndHorizontal(); mirrorOffset = RTEditorGUI.IntSlider(mirrorOffset, 0, 95); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(4); GUILayout.EndVertical(); if (GUI.changed) { NodeEditor.curNodeCanvas.OnNodeChange(this); } }
public void SideGUI() { GUILayout.BeginArea(new Rect(canvasRect.x + state.canvasRect.width, state.canvasRect.y, 200, state.canvasRect.height), NodeEditorGUI.nodeSkin.box); GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")", "The currently opened canvas in the Node Editor")); screenSize = GUILayout.Toggle(screenSize, "Adapt to Screen"); GUILayout.Label("FPS: " + FPSCounter.currentFPS); GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")"), NodeEditorGUI.nodeLabelBold); #if UNITY_EDITOR if (GUILayout.Button(new GUIContent("Save Canvas", "Saves the Canvas to a Canvas Save File in the Assets Folder"))) { string path = UnityEditor.EditorUtility.SaveFilePanelInProject("Save Node Canvas", "Node Canvas", "asset", "", NodeEditor.editorPath + "Resources/Saves/"); if (!string.IsNullOrEmpty(path)) { NodeEditorSaveManager.SaveNodeCanvas(path, true, canvas, state); } } if (GUILayout.Button(new GUIContent("Load Canvas", "Loads the Canvas from a Canvas Save File in the Assets Folder"))) { string path = UnityEditor.EditorUtility.OpenFilePanel("Load Node Canvas", NodeEditor.editorPath + "Resources/Saves/", "asset"); if (!path.Contains(Application.dataPath)) { if (!string.IsNullOrEmpty(path)) { Debug.LogWarning("You should select an asset inside your project folder!"); } } else { path = path.Replace(Application.dataPath, "Assets"); LoadNodeCanvas(path); } } #endif if (GUILayout.Button(new GUIContent("New Canvas", "Loads an empty Canvas"))) { NewNodeCanvas(); } if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually."))) { NodeEditor.RecalculateAll(canvas); } if (GUILayout.Button("Force Re-Init")) { NodeEditor.ReInit(true); } NodeEditorGUI.knobSize = RTEditorGUI.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20); state.zoom = RTEditorGUI.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), state.zoom, 0.6f, 2); GUILayout.EndArea(); }
protected internal override void InspectorNodeGUI() { m_Value1 = RTEditorGUI.IntSlider(m_Value1, 0, 10); //,new GUIContent("Red", "Float"), m_R); m_Value2 = RTEditorGUI.Slider(m_Value2, 0.0f, 500.0f); //,new GUIContent("Red", "Float"), m_R); m_Value3 = RTEditorGUI.Slider(m_Value3, 0.0f, 0.5f); //,new GUIContent("Red", "Float"), m_R); if (m_Cached != null) { GUILayout.Label(m_Cached); } }
protected void IntKnobOrSlider(ref int val, int min, int max, ValueConnectionKnob knob, params GUILayoutOption[] layoutOpts) { GUILayout.BeginHorizontal(); knob.DisplayLayout(); if (!knob.connected()) { val = RTEditorGUI.IntSlider(val, min, max, layoutOpts); } else { val = knob.GetValue <int>(); } GUILayout.EndHorizontal(); }
public override void NodeGUI() { GUILayout.BeginVertical(); filterLowEnd = RTEditorGUI.IntSlider(filterLowEnd, 0, filterHighEnd); filterHighEnd = RTEditorGUI.IntSlider(filterHighEnd, filterLowEnd, spectrumSize); GUILayout.BeginHorizontal(); spectrumDataKnob.DisplayLayout(); outputSignalKnob.DisplayLayout(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); if (GUI.changed) { NodeEditor.curNodeCanvas.OnNodeChange(this); } }
public void SideGUI() { GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")", "The currently opened canvas in the Node Editor")); screenSize = GUILayout.Toggle(screenSize, "Adapt to Screen"); GUILayout.Label("FPS: " + FPSCounter.currentFPS); GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")"), NodeEditorGUI.nodeLabelBold); if (GUILayout.Button(new GUIContent("New Canvas", "Loads an empty Canvas"))) { NewNodeCanvas(); } GUILayout.Space(6f); GUILayout.BeginHorizontal(); sceneCanvasName = GUILayout.TextField(sceneCanvasName, GUILayout.ExpandWidth(true)); if (GUILayout.Button(new GUIContent("Save to Scene", "Saves the Canvas to the Scene"), GUILayout.ExpandWidth(false))) { SaveSceneNodeCanvas(sceneCanvasName); } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Load from Scene", "Loads the Canvas from the Scene"))) { GenericMenu genericMenu = new GenericMenu(); string[] sceneSaves = NodeEditorSaveManager.GetSceneSaves(); foreach (string text in sceneSaves) { genericMenu.AddItem(new GUIContent(text), false, LoadSceneCanvasCallback, text); } genericMenu.Show(loadScenePos, 40f); } if (Event.current.type == EventType.Repaint) { Rect lastRect = GUILayoutUtility.GetLastRect(); loadScenePos = new Vector2(lastRect.x + 2f, lastRect.yMax + 2f); } GUILayout.Space(6f); if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually."))) { NodeEditor.RecalculateAll(canvas); } if (GUILayout.Button("Force Re-Init")) { NodeEditor.ReInit(true); } NodeEditorGUI.knobSize = RTEditorGUI.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20); state.zoom = RTEditorGUI.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), state.zoom, 0.6f, 2f); }
public override void DrawNodePropertyEditor() { base.DrawNodePropertyEditor(); m_OpType = (TexOP)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Type", "The type of calculation performed on Input 1"), m_OpType, GUILayout.MaxWidth(200)); m_Wrapping = GUILayout.Toggle(m_Wrapping, "Wrapping:"); m_Uniform = GUILayout.Toggle(m_Uniform, "Uniform:"); { //m_Value1 .SliderLabel(this, "Period", m_Value1, 0.0f, 8.0f); if (m_Uniform) { m_Value5.SliderLabel(this, "Scale");//, m_Value5, 0.0f, 100.0f); m_Value6 = m_Value5; //,new GUIContent("Red", "Float"), m_R); } else { m_Value5.SliderLabel(this, "ScaleX"); //, m_Value5, 0.0f, 100.0f); //,new GUIContent("Red", "Float"), m_R); m_Value6.SliderLabel(this, "ScaleY"); //, m_Value6, 0.0f, 100.0f); //,new GUIContent("Red", "Float"), m_R); } if (m_Wrapping) { m_Value6.Floor(); //.m_Value = Mathf.Floor(m_Value6.m_Value); m_Value5.Floor(); //.m_Value = Mathf.Floor(m_Value5.m_Value); } m_Value7.SliderLabel(this, "OffsetX"); //, 0.0f, 1.0f);//,new GUIContent("Red", "Float"), m_R); m_Value8.SliderLabel(this, "OffsetY"); //, 0.0f, 1.0f);//,new GUIContent("Red", "Float"), m_R); m_Value3.SliderLabel(this, "OffsetZ"); //, 0.0f, 1.0f);//,new GUIContent("Red", "Float"), m_R); // m_frequency.SliderLabel(this,"Frequency", m_frequency, 0.0f, 100.0f);//,new GUIContent("Red", "Float"), m_R); m_lacunarity.SliderLabel(this, "FreqScalePerOctave"); //, 0.0f, 10.0f);//,new GUIContent("Red", "Float"), m_R); m_gain.SliderLabel(this, "AmpGainPerOctave"); //, 0.0f, 10.0f);//,new GUIContent("Red", "Float"), m_R); if (m_OpType == TexOP.VeroniNoise) { m_jitter.SliderLabel(this, "Jitter");//, 0.0f, 1.0f);//,new GUIContent("Red", "Float"), m_R); //m_amp = RTEditorGUI.Slider(m_amp, -10.0f, 10.0f);//,new GUIContent("Red", "Float"), m_R); } m_Octaves = RTEditorGUI.IntSlider(new GUIContent("Octaves"), m_Octaves, 1, 10);//,new GUIContent("Red", "Float"), m_R); } }
public override void NodeGUI() { GUILayout.BeginVertical(); if (EventKnobOrButton("Manual jitter", ManualJitterKnob)) { JitterFlies(); } countKnob.DisplayLayout(); if (!countKnob.connected()) { Count = RTEditorGUI.IntSlider(Count, 1, 100); } else { Count = countKnob.GetValue <int>(); } trailKnob.DisplayLayout(); if (!trailKnob.connected()) { Trail = RTEditorGUI.Slider(Trail, 0, 0.1f); } else { Trail = trailKnob.GetValue <float>(); } GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Box(outputTex, GUILayout.MaxWidth(64), GUILayout.MaxHeight(64)); GUILayout.EndHorizontal(); GUILayout.Space(4); GUILayout.EndVertical(); outputTexKnob.SetPosition(180); if (GUI.changed) { NodeEditor.curNodeCanvas.OnNodeChange(this); } }
public override void NodeGUI() { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); textureInputKnob.DisplayLayout(); reflectionsInputKnob.DisplayLayout(new GUIContent("Reflections", "The number of reflections")); if (!reflectionsInputKnob.connected()) { reflections = RTEditorGUI.IntSlider(reflections, 1, 10); } GUILayout.EndVertical(); textureOutputKnob.DisplayLayout(); GUILayout.EndHorizontal(); if (GUI.changed) { NodeEditor.curNodeCanvas.OnNodeChange(this); } }
public override void NodeGUI() { GUILayout.BeginVertical(); IntervalKnob.DisplayLayout(); if (!IntervalKnob.connected()) { Interval = RTEditorGUI.IntSlider(Interval, 1, 10); } else { Interval = IntervalKnob.GetValue <int>(); } FadeKnob.DisplayLayout(); if (!FadeKnob.connected()) { Fade = RTEditorGUI.Slider(Fade, 1, 10); } else { Fade = FadeKnob.GetValue <float>(); } Fill = RTEditorGUI.Toggle(Fill, new GUIContent("Fill", "Fill circles")); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Box(outputTex, GUILayout.MaxWidth(64), GUILayout.MaxHeight(64)); GUILayout.EndHorizontal(); GUILayout.Space(4); GUILayout.EndVertical(); outputTexKnob.SetPosition(236); if (GUI.changed) { NodeEditor.curNodeCanvas.OnNodeChange(this); } }
public override void NodeGUI() { GUILayout.BeginVertical(); // 1st row GUILayout.BeginHorizontal(); // Capture mode - system audio vs mic GUILayout.BeginVertical(); GUILayout.Label("Audio source"); #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN RadioButtons(captureModeSelection); #else GUILayout.Label("Mic"); #endif GUILayout.EndVertical(); // Spectrum scaling mode - sqrt/decibel/linear GUILayout.BeginVertical(); GUILayout.Label("Scaling"); RadioButtons(scalingModeSelection); GUILayout.EndVertical(); //Min / max frequency GUILayout.BeginVertical(); GUILayout.Label("Min freq"); newMinFreq = RTEditorGUI.IntField(minFreq); GUILayout.Label("Max freq"); newMaxFreq = RTEditorGUI.IntField(maxFreq); GUILayout.EndVertical(); GUILayout.EndHorizontal(); //Smoothing iterations GUILayout.BeginHorizontal(); GUILayout.Label("Smoothing"); newSmoothing = RTEditorGUI.IntSlider(smoothingIterations, 1, 10, GUILayout.MaxWidth(DefaultSize.x - 60)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); var label = capturing ? "Stop capture" : "Start capture"; if (GUILayout.Button(label)) { capturing = !capturing; if (!capturing) { wasapiAudio.StopListen(); } else { InitializeWasapiCapture(); wasapiAudio.StartListen(); } } spectrumDataKnob.DisplayLayout(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); if (GUI.changed) { NodeEditor.curNodeCanvas.OnNodeChange(this); } }
public void SideGUI() { GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")", "The currently opened canvas in the Node Editor")); screenSize = GUILayout.Toggle(screenSize, "Adapt to Screen"); GUILayout.Label("FPS: " + FPSCounter.currentFPS); GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")"), NodeEditorGUI.nodeLabelBold); if (GUILayout.Button(new GUIContent("New Canvas", "Loads an empty Canvas"))) { NewNodeCanvas(); } GUILayout.Space(6); #if UNITY_EDITOR if (GUILayout.Button(new GUIContent("Save Canvas", "Saves the Canvas to a Canvas Save File in the Assets Folder"))) { string path = UnityEditor.EditorUtility.SaveFilePanelInProject("Save Node Canvas", "Node Canvas", "asset", "", NodeEditor.editorPath + "Resources/Saves/"); if (!string.IsNullOrEmpty(path)) { NodeEditorSaveManager.SaveNodeCanvas(path, canvas, true); } } if (GUILayout.Button(new GUIContent("Load Canvas", "Loads the Canvas from a Canvas Save File in the Assets Folder"))) { string path = UnityEditor.EditorUtility.OpenFilePanel("Load Node Canvas", NodeEditor.editorPath + "Resources/Saves/", "asset"); if (!path.Contains(Application.dataPath)) { if (!string.IsNullOrEmpty(path)) { Debug.LogWarning("You should select an asset inside your project folder!"); } } else { path = path.Replace(Application.dataPath, "Assets"); LoadNodeCanvas(path); } } GUILayout.Space(6); #endif GUILayout.BeginHorizontal(); sceneCanvasName = GUILayout.TextField(sceneCanvasName, GUILayout.ExpandWidth(true)); if (GUILayout.Button(new GUIContent("Save to Scene", "Saves the Canvas to the Scene"), GUILayout.ExpandWidth(false))) { SaveSceneNodeCanvas(sceneCanvasName); } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Load from Scene", "Loads the Canvas from the Scene"))) { NodeEditorFramework.Utilities.GenericMenu menu = new NodeEditorFramework.Utilities.GenericMenu(); foreach (string sceneSave in NodeEditorSaveManager.GetSceneSaves()) { menu.AddItem(new GUIContent(sceneSave), false, LoadSceneCanvasCallback, (object)sceneSave); } menu.Show(loadScenePos); } if (Event.current.type == EventType.Repaint) { Rect popupPos = GUILayoutUtility.GetLastRect(); loadScenePos = new Vector2(popupPos.x + 2, popupPos.yMax + 2); } GUILayout.Space(6); if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually."))) { NodeEditor.RecalculateAll(canvas); } if (GUILayout.Button("Force Re-Init")) { NodeEditor.ReInit(true); } NodeEditorGUI.knobSize = RTEditorGUI.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20); state.zoom = RTEditorGUI.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), state.zoom, 0.6f, 2); }
public void SideGUI() { GUILayout.Label(new GUIContent("" + cache.nodeCanvas.saveName + " (" + (cache.nodeCanvas.livesInScene? "Scene Save" : "Asset Save") + ")", "Opened Canvas path: " + cache.nodeCanvas.savePath), NodeEditorGUI.nodeLabelBold); GUILayout.Label("Type: " + cache.typeData.DisplayString + "/" + cache.nodeCanvas.GetType().Name + ""); if (GUILayout.Button(new GUIContent("New Canvas", "Loads an Specified Empty CanvasType"))) { NodeEditorFramework.Utilities.GenericMenu menu = new NodeEditorFramework.Utilities.GenericMenu(); NodeCanvasManager.FillCanvasTypeMenu(ref menu, cache.NewNodeCanvas); menu.Show(createCanvasUIPos.position, createCanvasUIPos.width); } if (Event.current.type == EventType.Repaint) { Rect popupPos = GUILayoutUtility.GetLastRect(); createCanvasUIPos = new Rect(popupPos.x + 2, popupPos.yMax + 2, popupPos.width - 4, 0); } if (cache.nodeCanvas.GetType() == typeof(NodeCanvas) && GUILayout.Button(new GUIContent("Convert Canvas", "Converts the current canvas to a new type."))) { NodeEditorFramework.Utilities.GenericMenu menu = new NodeEditorFramework.Utilities.GenericMenu(); NodeCanvasManager.FillCanvasTypeMenu(ref menu, cache.ConvertCanvasType); menu.Show(convertCanvasUIPos.position, convertCanvasUIPos.width); } if (Event.current.type == EventType.Repaint) { Rect popupPos = GUILayoutUtility.GetLastRect(); convertCanvasUIPos = new Rect(popupPos.x + 2, popupPos.yMax + 2, popupPos.width - 4, 0); } if (GUILayout.Button(new GUIContent("Save Canvas", "Save the Canvas to the load location"))) { string path = cache.nodeCanvas.savePath; if (!string.IsNullOrEmpty(path)) { if (path.StartsWith("SCENE/")) { cache.SaveSceneNodeCanvas(path.Substring(6)); } else { cache.SaveNodeCanvas(path); } } } #if UNITY_EDITOR GUILayout.Label("Asset Saving", NodeEditorGUI.nodeLabel); if (GUILayout.Button(new GUIContent("Save Canvas As", "Save the canvas as an asset"))) { string panelPath = NodeEditor.editorPath + "Resources/Saves/"; if (cache.nodeCanvas != null && !string.IsNullOrEmpty(cache.nodeCanvas.savePath)) { panelPath = cache.nodeCanvas.savePath; } string path = UnityEditor.EditorUtility.SaveFilePanelInProject("Save Node Canvas", "Node Canvas", "asset", "", panelPath); if (!string.IsNullOrEmpty(path)) { cache.SaveNodeCanvas(path); } } if (GUILayout.Button(new GUIContent("Load Canvas", "Load the Canvas from an asset"))) { string panelPath = NodeEditor.editorPath + "Resources/Saves/"; if (cache.nodeCanvas != null && !string.IsNullOrEmpty(cache.nodeCanvas.savePath)) { panelPath = cache.nodeCanvas.savePath; } string path = UnityEditor.EditorUtility.OpenFilePanel("Load Node Canvas", panelPath, "asset"); if (!path.Contains(Application.dataPath)) { if (!string.IsNullOrEmpty(path)) { Debug.LogWarning(new GUIContent("You should select an asset inside your project folder!")); } } else { cache.LoadNodeCanvas(path); } if (cache.nodeCanvas.GetType() == typeof(NodeCanvas)) { Debug.LogWarning(new GUIContent("The Canvas has no specific type. Please use the convert button to assign a type and re-save the canvas!")); } } #endif GUILayout.Label("Scene Saving", NodeEditorGUI.nodeLabel); GUILayout.BeginHorizontal(); sceneCanvasName = GUILayout.TextField(sceneCanvasName, GUILayout.ExpandWidth(true)); if (GUILayout.Button(new GUIContent("Save to Scene", "Save the canvas to the Scene"), GUILayout.ExpandWidth(false))) { cache.SaveSceneNodeCanvas(sceneCanvasName); } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Load from Scene", "Load the canvas from the Scene"))) { NodeEditorFramework.Utilities.GenericMenu menu = new NodeEditorFramework.Utilities.GenericMenu(); foreach (string sceneSave in NodeEditorSaveManager.GetSceneSaves()) { menu.AddItem(new GUIContent(sceneSave), false, LoadSceneCanvasCallback, (object)sceneSave); } menu.Show(loadSceneUIPos.position, loadSceneUIPos.width); } if (Event.current.type == EventType.Repaint) { Rect popupPos = GUILayoutUtility.GetLastRect(); loadSceneUIPos = new Rect(popupPos.x + 2, popupPos.yMax + 2, popupPos.width - 4, 0); } GUILayout.Label("Utility/Debug", NodeEditorGUI.nodeLabel); if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually."))) { cache.nodeCanvas.TraverseAll(); } if (GUILayout.Button("Force Re-Init")) { NodeEditor.ReInit(true); } NodeEditorGUI.knobSize = RTEditorGUI.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20); //cache.editorState.zoom = EditorGUILayout.Slider (new GUIContent ("Zoom", "Use the Mousewheel. Seriously."), cache.editorState.zoom, 0.6f, 4); NodeEditorUserCache.cacheIntervalSec = RTEditorGUI.IntSlider(new GUIContent("Cache Interval (Sec)", "The interval in seconds the canvas is temporarily saved into the cache as a precaution for crashes."), NodeEditorUserCache.cacheIntervalSec, 30, 300); screenSize = GUILayout.Toggle(screenSize, "Adapt to Screen"); GUILayout.Label("FPS: " + FPSCounter.currentFPS); if (cache.editorState.selectedNode != null && Event.current.type != EventType.Ignore) { cache.editorState.selectedNode.DrawNodePropertyEditor(); } }