Fixed in unity 2021
This commit is contained in:
parent
e60d3604c0
commit
20818926de
@ -1,5 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
#if UNITY_2022_OR_NEWER
|
||||||
using UnityEngine.UIElements;
|
using UnityEngine.UIElements;
|
||||||
|
#else
|
||||||
|
using UnityEditor.UIElements;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace ImageProcessingGraph.Editor
|
namespace ImageProcessingGraph.Editor
|
||||||
{
|
{
|
||||||
@ -13,11 +18,12 @@ namespace ImageProcessingGraph.Editor
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GreyscaleField : IntegerField
|
public class GreyscaleField : IntegerField
|
||||||
{
|
{
|
||||||
public (int, int) minMax = (0,255);
|
public (int, int) minMax = (0,255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -6,7 +6,7 @@ using Unity.Burst;
|
|||||||
|
|
||||||
namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Utilities.ViewNode
|
namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Utilities.ViewNode
|
||||||
{
|
{
|
||||||
[NodeInfo("View Texture", "Utility/View Texture", false, null ,typeof(ViewTextureNodeEditor))]
|
[NodeInfo("View Texture", "Utility/View Texture", false, null , editorType: typeof(ViewTextureNodeEditor))]
|
||||||
public partial class ViewTextureNode : BaseImageNode
|
public partial class ViewTextureNode : BaseImageNode
|
||||||
{
|
{
|
||||||
[NodeAttributes.Input("Texture")] public Texture2D texture;
|
[NodeAttributes.Input("Texture")] public Texture2D texture;
|
||||||
|
@ -312,7 +312,19 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
// Add more types as needed
|
// Add more types as needed
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void BuildContextualMenu(ContextualMenuPopulateEvent evt)
|
||||||
|
{
|
||||||
|
evt.menu.InsertAction(evt.menu.MenuItems().Count, "Open Documentation", OpenDocumentation);
|
||||||
|
evt.menu.AppendSeparator();
|
||||||
|
base.BuildContextualMenu(evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenDocumentation(DropdownMenuAction obj)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void SavePosition() => graphNode.SetPosition(GetPosition());
|
public void SavePosition() => graphNode.SetPosition(GetPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,20 +72,16 @@ namespace ImageProcessingGraph.Editor
|
|||||||
|
|
||||||
DrawNodes();
|
DrawNodes();
|
||||||
DrawConnections();
|
DrawConnections();
|
||||||
|
|
||||||
foreach (var conn in asset.Connections)
|
|
||||||
{
|
|
||||||
if (conn.internalEdge == null)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//GetNode(conn.inputPort.nodeID).ToggleExposedVariable(conn.internalEdge.input, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
graphViewChanged += OnGraphViewChanged;
|
graphViewChanged += OnGraphViewChanged;
|
||||||
Undo.undoRedoEvent += UndoEvent;
|
|
||||||
|
Undo.undoRedoPerformed += UndoRedoPerformed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UndoRedoPerformed()
|
||||||
|
{
|
||||||
|
DrawNodes();
|
||||||
|
DrawConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateButtons()
|
private void CreateButtons()
|
||||||
@ -237,12 +233,6 @@ namespace ImageProcessingGraph.Editor
|
|||||||
return compatiblePorts;
|
return compatiblePorts;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UndoEvent(in UndoRedoInfo undo)
|
|
||||||
{
|
|
||||||
DrawNodes();
|
|
||||||
DrawConnections();
|
|
||||||
}
|
|
||||||
|
|
||||||
private GraphViewChange OnGraphViewChanged(GraphViewChange graphviewchange)
|
private GraphViewChange OnGraphViewChanged(GraphViewChange graphviewchange)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user