diff --git a/Editor/Scripts/Editor/Nodes/NodeAttributes/NewMonoBehaviour.cs b/Editor/Scripts/Editor/Nodes/NodeAttributes/NewMonoBehaviour.cs deleted file mode 100644 index 507e7ab..0000000 --- a/Editor/Scripts/Editor/Nodes/NodeAttributes/NewMonoBehaviour.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class NewMonoBehaviour : MonoBehaviour -{ - // Use this for initialization - void Start() - { - - } - - // Update is called once per frame - void Update() - { - - } -} diff --git a/Editor/Scripts/Editor/Nodes/NodeAttributes/NewMonoBehaviour.cs.meta b/Editor/Scripts/Editor/Nodes/NodeAttributes/NewMonoBehaviour.cs.meta deleted file mode 100644 index 923ba9f..0000000 --- a/Editor/Scripts/Editor/Nodes/NodeAttributes/NewMonoBehaviour.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 78c0de359ceae406cb2985637a2e6c97 \ No newline at end of file diff --git a/Editor/Scripts/Editor/Nodes/NodeAttributes/NodeAttributes.cs b/Editor/Scripts/Editor/Nodes/NodeAttributes/NodeAttributes.cs index 0ce9277..ff5b717 100644 --- a/Editor/Scripts/Editor/Nodes/NodeAttributes/NodeAttributes.cs +++ b/Editor/Scripts/Editor/Nodes/NodeAttributes/NodeAttributes.cs @@ -10,18 +10,21 @@ namespace ImageProcessingGraph.Editor.Nodes.NodeAttributes private string menuItem; private string ussPath; private Type editorType; + private string docuementationURL; public string Title => name; public string MenuItem => menuItem; public string UssPath => ussPath; public Type EditorType => editorType; + public string DocumentationationURL => docuementationURL; - public NodeInfoAttribute(string name, string menuItem = "", bool requiresImage = false, string ussPath = null, Type editorType = null) + public NodeInfoAttribute(string name, string menuItem = "", bool requiresImage = false, string ussPath = null, Type editorType = null, string docuementationURL = null) { this.name = name; this.menuItem = menuItem; this.ussPath = ussPath; this.editorType = editorType; + this.docuementationURL = docuementationURL; } } diff --git a/Editor/Scripts/Editor/Nodes/String Nodes/StringAppend.cs b/Editor/Scripts/Editor/Nodes/String Nodes/StringAppend.cs deleted file mode 100644 index f82a814..0000000 --- a/Editor/Scripts/Editor/Nodes/String Nodes/StringAppend.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ImageProcessingGraph.Editor.Nodes.NodeAttributes; - -namespace ImageProcessingGraph.Editor.Nodes.String_Nodes -{ - [NodeInfo("String Append", "String/Append")] - public class StringAppend : BaseImageNode - { - [NodeAttributes.Input("String A")] public string baseString; - [NodeAttributes.Input("String B")] public string appendString; - - [NodeAttributes.Output("Appended String")] public string output; - - public override void Process() - { - this.output = baseString + appendString; - } - } -} \ No newline at end of file diff --git a/Editor/Scripts/Editor/Nodes/String Nodes/StringNodes.cs b/Editor/Scripts/Editor/Nodes/String Nodes/StringNodes.cs new file mode 100644 index 0000000..51f33ed --- /dev/null +++ b/Editor/Scripts/Editor/Nodes/String Nodes/StringNodes.cs @@ -0,0 +1,69 @@ +using ImageProcessingGraph.Editor.Nodes.NodeAttributes; + + +namespace ImageProcessingGraph.Editor.Nodes.String_Nodes +{ + [NodeInfo("String Append", "String/Append", docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes/String/Append")] + public class StringAppend : BaseImageNode + { + [NodeAttributes.Input("String A")] public string baseString; + [NodeAttributes.Input("String B")] public string appendString; + + [NodeAttributes.Output("Appended String")] public string output; + + public override void Process() + { + this.output = baseString + appendString; + } + } + + [NodeInfo("String Replace", "String/Replace", docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes/String/Replace")] + public class StringReplace : BaseImageNode + { + [NodeAttributes.Input("Original String")] public string original; + [NodeAttributes.Input("Old Value")] public string oldValue; + [NodeAttributes.Input("New Value")] public string newValue; + + [NodeAttributes.Output("Replaced String")] public string output; + + public override void Process() + { + if (!string.IsNullOrEmpty(original) && oldValue != null) + output = original.Replace(oldValue, newValue); + else + output = original; + } + } + + [NodeInfo("String Split", "String/Split", docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes/String/Split")] + public class StringSplit : BaseImageNode + { + [Input("Source String")] public string source; + [Input("Delimiter")] public string delimiter; + + [NodeAttributes.Output("Before Delimiter")] public string before; + [NodeAttributes.Output("After Delimiter")] public string after; + + public override void Process() + { + if (string.IsNullOrEmpty(source) || string.IsNullOrEmpty(delimiter)) + { + before = source; + after = string.Empty; + return; + } + + int index = source.IndexOf(delimiter); + if (index >= 0) + { + before = source.Substring(0, index); + after = source.Substring(index + delimiter.Length); + } + else + { + before = source; + after = string.Empty; + } + } + } +} \ No newline at end of file diff --git a/Editor/Scripts/Editor/Nodes/String Nodes/StringAppend.cs.meta b/Editor/Scripts/Editor/Nodes/String Nodes/StringNodes.cs.meta similarity index 100% rename from Editor/Scripts/Editor/Nodes/String Nodes/StringAppend.cs.meta rename to Editor/Scripts/Editor/Nodes/String Nodes/StringNodes.cs.meta diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/InvertChannel.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/InvertChannel.cs index 077896d..cb4f33e 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/InvertChannel.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/InvertChannel.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture { - [NodeInfoAttribute("Invert Channel", "Adjustments/InvertChannel", true)] + [NodeInfoAttribute("Invert Channel", "Adjustments/InvertChannel", true, docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FInvertChannel")] public class ChannelInvertNode : BaseImageNode { [NodeAttributes.Input("Input Channel")] diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DDesaturate.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DDesaturate.cs index 472c137..c11fd92 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DDesaturate.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DDesaturate.cs @@ -8,14 +8,14 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture { - [NodeInfoAttribute("Desaturate", "Adjustments/Desaturate", true)] + [NodeInfoAttribute("Desaturate", "Adjustments/Desaturate", true, docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FDesaturate")] public class Texture2DDesaturate : BaseImageNode { [NodeAttributes.Input("")] - public ImageData inputTexture; // Changed to ImageData - - [NodeAttributes.Output("")] - public ImageData outputTexture; // Changed to ImageData + public ImageData inputTexture; + + [NodeAttributes.Output("")] + public ImageData outputTexture; public override void Process() { diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DInvert.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DInvert.cs index ea4b3bd..5415914 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DInvert.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Adjustments/Texture2DInvert.cs @@ -6,21 +6,19 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture { - [NodeInfoAttribute("Invert", "Adjustments/Invert", true)] + [NodeInfoAttribute("Invert", "Adjustments/Invert", true, docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FInvert")] public class Texture2DInvert : BaseImageNode { [NodeAttributes.Input("")] - public ImageData inputTexture; // Changed to ImageData + public ImageData inputTexture; [NodeAttributes.Output("")] - public ImageData outputTexture; // Changed to ImageData + public ImageData outputTexture; public override void Process() { - // Create an empty NativeArray for the output NativeArray output = new NativeArray(inputTexture.PixelData.Length, Allocator.Persistent); - // Create and run the InvertJob InvertJob job = new InvertJob { pixels = inputTexture.PixelData, @@ -29,7 +27,6 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture job.Run(); - // Store the result in the outputImage as an ImageData instance outputTexture = new ImageData(output, (inputTexture.Width, inputTexture.Height), inputTexture.isRGBA); } } @@ -37,14 +34,13 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture [BurstCompile] public struct InvertJob : IJob { - [ReadOnly] public NativeArray pixels; // Input pixels - [WriteOnly] public NativeArray outputPixels; // Output pixels + [ReadOnly] public NativeArray pixels; + [WriteOnly] public NativeArray outputPixels; public void Execute() { int length = pixels.Length; - // Invert each pixel color for (int i = 0; i < length; i++) { Color32 pixel = pixels[i]; diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBACombine.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBACombine.cs index 6ae5113..c3752bd 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBACombine.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBACombine.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture { - [NodeInfo("RGBA Combine", "Channels/RGBA Combine", true)] + [NodeInfo("RGBA Combine", "Channels/RGBA Combine", true, docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FRGBACombine")] public class RGBASCombine : BaseImageNode { [NodeAttributes.Input("R")] diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBASplit.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBASplit.cs index 958b1ba..d8ef565 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBASplit.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Channels/RGBASplit.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture { - [NodeInfoAttribute("RGBA Split", "Channels/RGBA Split", true)] + [NodeInfoAttribute("RGBA Split", "Channels/RGBA Split", true, docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FRGBASplit")] public class RGBASplit : BaseImageNode { [NodeAttributes.Input("")] diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Dimensions/GetDimensions.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Dimensions/GetDimensions.cs index 8196161..55d3a2b 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Dimensions/GetDimensions.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Dimensions/GetDimensions.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture { - [NodeInfoAttribute("Get Dimensions", "Dimensions/Get Dimensions", false)] + [NodeInfoAttribute("Get Dimensions", "Dimensions/Get Dimensions", false, docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FGetDimensions")] public class TextureGetDimensions : BaseImageNode { [NodeAttributes.Input("")] diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Export/Texture2DOutput.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Export/Texture2DOutput.cs index ab92a62..7a00628 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Export/Texture2DOutput.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Export/Texture2DOutput.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Output { - [NodeInfo("Texture Export", "Export/Texture Export", true)] + [NodeInfo("Texture Export", "Export/Texture Export", true,docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FTexture2DOutput")] public class Texture2DOutput : BaseImageNode { [NodeAttributes.Input("")] public ImageData inputPixels; diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/From Path Nodes/FromPathNode.cs b/Editor/Scripts/Editor/Nodes/Types/Image/From Path Nodes/FromPathNode.cs index 47a158f..740fd0e 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/From Path Nodes/FromPathNode.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/From Path Nodes/FromPathNode.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Security.Policy; using ImageProcessingGraph.Editor.Nodes.NodeAttributes; using UnityEditor; using UnityEngine; @@ -31,12 +32,12 @@ namespace ImageProcessingGraph.Editor.Nodes.Types.Image.From_Path_Nodes } } - [NodeInfo("Load Texture2D From path", "Load From Path/Texture2D")] + [NodeInfo("Load Texture2D From path", "Load From Path/Texture2D", docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImages%2FFromPathNode")] public class Texture2DFromPath : FromPathNode { } - [NodeInfo("Load Mesh From path", "Load From Path/Mesh")] + [NodeInfo("Load Mesh From path", "Load From Path/Mesh", docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImages%2FFromPathNode")] public class MeshFromPath : FromPathNode { } - [NodeInfo("Load Prefab From path", "Load From Path/Prefab")] + [NodeInfo("Load Prefab From path", "Load From Path/Prefab", docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImages%2FFromPathNode")] public class PrefabFromPath : FromPathNode { } } \ No newline at end of file diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Import/Texture2DImport.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Import/Texture2DImport.cs index 5d75096..342b605 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Import/Texture2DImport.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Import/Texture2DImport.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace ImageProcessingGraph.Editor.Nodes.Import_Nodes { - [NodeInfo("Texture Import", "Imports/Import Texture")] + [NodeInfo("Texture Import", "Imports/Import Texture", docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FTexture2DImport")] public class Texture2DImport : BaseImageNode { [NodeAttributes.Input("")] diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/SingleChannelColor.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/SingleChannelColor.cs index aa1daeb..2eca278 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/SingleChannelColor.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/SingleChannelColor.cs @@ -8,7 +8,7 @@ namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Utilities { public class SingleChannelColor { - [NodeInfoAttribute("Channel Color", "Utility/Channel Color", false)] + [NodeInfoAttribute("Channel Color", "Utility/Channel Color", false, docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImages%2FSingleChannelColor")] public class SingleColorChannel : BaseImageNode { [NodeAttributes.Input("Color")] public GreyscaleValue range; diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/ViewNode/ViewImageNode.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/ViewNode/ViewImageNode.cs index a4bead3..3c21216 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/ViewNode/ViewImageNode.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Utilities/ViewNode/ViewImageNode.cs @@ -6,7 +6,7 @@ using Unity.Burst; namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Utilities.ViewNode { - [NodeInfo("View Texture", "Utility/View Texture", false, null , editorType: typeof(ViewTextureNodeEditor))] + [NodeInfo("View Texture", "Utility/View Texture", false, null , editorType: typeof(ViewTextureNodeEditor), docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FViewImageNode")] public partial class ViewTextureNode : BaseImageNode { [NodeAttributes.Input("Texture")] public Texture2D texture; diff --git a/Editor/Scripts/Editor/Nodes/Types/Image/Variable Node/VariableNode.cs b/Editor/Scripts/Editor/Nodes/Types/Image/Variable Node/VariableNode.cs index 0f58f84..e558ca5 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Image/Variable Node/VariableNode.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Image/Variable Node/VariableNode.cs @@ -28,12 +28,12 @@ namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Variable_Node } } - [NodeInfo("Texture2D Variable", "Variable/Texture2D")] + [NodeInfo("Texture2D Variable", "Variable/Texture2D", docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FVariableNode")] public class Texture2DVariableNode : VariableNode { } - [NodeInfo("Mesh Variable", "Variable/Mesh")] + [NodeInfo("Mesh Variable", "Variable/Mesh", docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FVariableNode")] public class MeshVariableNode : VariableNode { } - [NodeInfo("Prefab Variable", "Variable/Prefab")] + [NodeInfo("Prefab Variable", "Variable/Prefab", docuementationURL:"https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FImage%2FVariableNode")] public class PrefabVariableNode : VariableNode { } } \ No newline at end of file diff --git a/Editor/Scripts/Editor/Nodes/Types/Utils/Connector/GenericConnection.cs b/Editor/Scripts/Editor/Nodes/Types/Utils/Connector/GenericConnection.cs index f35fe54..8f4c10e 100644 --- a/Editor/Scripts/Editor/Nodes/Types/Utils/Connector/GenericConnection.cs +++ b/Editor/Scripts/Editor/Nodes/Types/Utils/Connector/GenericConnection.cs @@ -6,7 +6,7 @@ using UnityEngine.UIElements; namespace ImageProcessingGraph.Editor.Nodes.Types.Utils.Connector { - [NodeInfo("", "Utility/Connection", false, null , editorType: typeof(GenericConnectionEditor))] + [NodeInfo("", "Utility/Connection", false, null , editorType: typeof(GenericConnectionEditor), docuementationURL: "https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Nodes%2FUtils%2FGenericConnection")] public class GenericConnection : BaseImageNode { private System.Type internalType; diff --git a/Editor/Scripts/Editor/Windows/Getting Started.meta b/Editor/Scripts/Editor/Windows/Getting Started.meta new file mode 100644 index 0000000..2002a21 --- /dev/null +++ b/Editor/Scripts/Editor/Windows/Getting Started.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 701fddc3e03215a47a5e29169f936f05 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.cs b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.cs new file mode 100644 index 0000000..9c46f0b --- /dev/null +++ b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.cs @@ -0,0 +1,150 @@ +using UnityEditor; +using UnityEditor.PackageManager.UI; +using UnityEngine; +using UnityEngine.UIElements; + +public class GettingStartedWindow : EditorWindow +{ + private static Vector2 WindowSize = new Vector2(400, 600); + + + [MenuItem("Image Graph/Getting Started")] + public static void ShowExample() + { + GettingStartedWindow wnd = GetWindow(); + wnd.titleContent = new GUIContent("Getting Started Window"); + wnd.minSize = WindowSize; + wnd.maxSize = WindowSize; + } + + public void CreateGUI() + { + Foldout foldoutCreateGraph = new Foldout(); + { + foldoutCreateGraph.name = "CreateGraph"; + foldoutCreateGraph.text = "Creating a Graph"; + AddBulletLabel(foldoutCreateGraph, "CreateGraphLabel", "Right click in project view"); + AddBulletLabel(foldoutCreateGraph, "PathLabel", "Create->Image Processing Graph->New Graph"); + AddBulletLabel(foldoutCreateGraph, "NameAsset", "Name Asset as Desired"); + } + foldoutCreateGraph.value = false; + rootVisualElement.Add(foldoutCreateGraph); + + Foldout foldoutOpenGraph = new Foldout(); + { + foldoutOpenGraph.name = "OpenGraph"; + foldoutOpenGraph.text = "Opening a Graph"; + AddBulletLabel(foldoutOpenGraph, "DoubleClick", "Double click newly created asset or pre-existing asset"); + AddBulletLabel(foldoutOpenGraph, "Inspector", "With a graph asset selected click the \"Open\" button"); + } + foldoutOpenGraph.value = false; + rootVisualElement.Add(foldoutOpenGraph); + + Foldout foldoutUsingTheGraph = new Foldout(); + { + foldoutUsingTheGraph.name = "Using the Graph"; + foldoutUsingTheGraph.text = "Using the Graph"; + + Foldout foldoutCreatingNodes = new Foldout(); + { + foldoutCreatingNodes.name = "Creating Nodes"; + foldoutCreatingNodes.text = "Creating Nodes"; + + AddBulletLabel(foldoutCreatingNodes, "HowToOpenSearch", "To open the node creation window press the \"Space\" button or Right Click -> Create Node"); + AddBulletLabel(foldoutCreatingNodes, "Search Window", "With the Search window now open find the node you wish to create and press the \"Enter\" key; Or double left click"); + AddBulletLabel(foldoutCreatingNodes, "Arrow Keys", "The search window can also be controlled with the arrow keys!"); + } + foldoutCreatingNodes.value = false; + foldoutUsingTheGraph.Add(foldoutCreatingNodes); + + Foldout foldoutDeletingNodes = new Foldout(); + { + foldoutDeletingNodes.name = "Deleting Nodes"; + foldoutDeletingNodes.text = "Deleting Nodes"; + + AddBulletLabel(foldoutDeletingNodes, "Deleting Nodes", "To delete a node, you can click the \"Delete\" Key or Right Click -> Delete Node"); + } + foldoutDeletingNodes.value = false; + foldoutUsingTheGraph.Add(foldoutDeletingNodes); + + Foldout foldoutConnectingNodes = new Foldout(); + { + foldoutConnectingNodes.name = "Connecting Nodes"; + foldoutConnectingNodes.text = "Connecting Nodes"; + + AddBulletLabel(foldoutConnectingNodes, "ConnectingNodes", "To connect two nodes you click and drag from one port to the other (Ports must be of same type)"); + AddBulletLabel(foldoutConnectingNodes, "ConnectingNodesTooltip", "Hovering over a port will show its type", 1); + AddBulletLabel(foldoutConnectingNodes, "DroppingConnection", "Dropping a connection in empty space will open a contextual search window"); + AddBulletLabel(foldoutConnectingNodes, "DroppingConnection1", "This window will only show nodes that are able to input/output to the port you dragged from.", 1); + } + foldoutConnectingNodes.value = false; + foldoutUsingTheGraph.Add(foldoutConnectingNodes); + + Foldout foldoutDeletingConnections = new Foldout(); + { + foldoutDeletingNodes.name = "Deleting Nodes"; + foldoutDeletingNodes.text = "Deleting Nodes"; + + AddBulletLabel(foldoutDeletingNodes, "Deleting Nodes", "To delete a node, you can click the \"Delete\" Key or Right Click -> Delete Node"); + } + foldoutDeletingNodes.value = false; + foldoutUsingTheGraph.Add(foldoutDeletingNodes); + } + foldoutUsingTheGraph.value = false; + rootVisualElement.Add(foldoutUsingTheGraph); + + Label bottomLabel = new Label("For more details, check the Quick Start Guide:"); + bottomLabel.style.marginTop = 20; + bottomLabel.style.unityFontStyleAndWeight = FontStyle.Bold; + rootVisualElement.Add(bottomLabel); + + Label hyperlink = new Label("Quick Start Guide") + { + style = + { + color = Color.blue, + unityFontStyleAndWeight = FontStyle.Italic + } + }; + hyperlink.RegisterCallback(ev => OpenQuickStartLink()); + rootVisualElement.Add(hyperlink); + } + + void AddBulletLabel(VisualElement container, string labelName, string labelText, int indentCount = 0) + { + var row = new VisualElement(); + row.style.flexDirection = FlexDirection.Row; + row.style.marginBottom = 2; + row.style.marginLeft = indentCount * 16; + + var bullet = new Label("•") + { + style = + { + width = 12, + unityFontStyleAndWeight = FontStyle.Bold, + marginRight = 4 + } + }; + + var labels = new Label(labelText) + { + name = labelName, + style = + { + unityFontStyleAndWeight = FontStyle.Normal, + whiteSpace = WhiteSpace.Normal, + flexGrow = 1 + } + }; + + row.Add(bullet); + row.Add(labels); + container.Add(row); + } + + private void OpenQuickStartLink() + { + Application.OpenURL("https://git.sam-green.dev/Chromum/UnityImageProcessing_Package/wiki/Guides/QuickStart"); + } +} diff --git a/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.cs.meta b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.cs.meta new file mode 100644 index 0000000..09f715a --- /dev/null +++ b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bdebc01d70ee90b46be92aff1599d2bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_VisualTreeAsset: {fileID: 9197481963319205126, guid: 9566e7fc6d4ac8848bdc7762e84f3d3d, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uss b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uss new file mode 100644 index 0000000..218263a --- /dev/null +++ b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uss @@ -0,0 +1,5 @@ +.custom-label { + font-size: 20px; + -unity-font-style: bold; + color: rgb(68, 138, 255); +} \ No newline at end of file diff --git a/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uss.meta b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uss.meta new file mode 100644 index 0000000..e954040 --- /dev/null +++ b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 966fc07be508c4244ba4c927e36a753a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uxml b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uxml new file mode 100644 index 0000000..277f121 --- /dev/null +++ b/Editor/Scripts/Editor/Windows/Getting Started/GettingStartedWindow.uxml @@ -0,0 +1,5 @@ + +