diff --git a/Source/Editor/Surface/Archetypes/Constants.cs b/Source/Editor/Surface/Archetypes/Constants.cs
index 581b87e0e..8dcfc8233 100644
--- a/Source/Editor/Surface/Archetypes/Constants.cs
+++ b/Source/Editor/Surface/Archetypes/Constants.cs
@@ -7,13 +7,11 @@ using Real = System.Single;
#endif
using System;
-using System.Linq;
using System.Reflection;
using FlaxEditor.CustomEditors.Editors;
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
using FlaxEditor.Surface.Elements;
-using FlaxEditor.Surface.Undo;
using FlaxEngine;
using FlaxEngine.GUI;
using FlaxEngine.Utilities;
@@ -348,7 +346,7 @@ namespace FlaxEditor.Surface.Archetypes
SetValue(0, array);
}
}
-
+
///
/// The nodes for that group.
///
@@ -358,7 +356,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 1,
Title = "Bool",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(bool))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(bool))),
Description = "Constant boolean value",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
@@ -391,7 +389,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 2,
Title = "Integer",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(int))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(int))),
Description = "Constant integer value",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
@@ -419,7 +417,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 3,
Title = "Float",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(float))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(float))),
Description = "Constant floating point",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
@@ -447,7 +445,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 4,
Title = "Float2",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Float2))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Float2))),
Description = "Constant Float2",
Flags = NodeFlags.AllGraphs,
Size = new Float2(130, 60),
@@ -478,7 +476,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 5,
Title = "Float3",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Float3))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Float3))),
Description = "Constant Float3",
Flags = NodeFlags.AllGraphs,
Size = new Float2(130, 80),
@@ -511,7 +509,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 6,
Title = "Float4",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Float4))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Float4))),
Description = "Constant Float4",
Flags = NodeFlags.AllGraphs,
Size = new Float2(130, 100),
@@ -546,7 +544,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 7,
Title = "Color",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Color))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Color))),
Description = "RGBA color",
Flags = NodeFlags.AllGraphs,
Size = new Float2(70, 100),
@@ -581,7 +579,7 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Rotation",
// TODO: Way too long and ugly - find a better way to add conversion
Create = (id, context, arch, groupArch) =>
- new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Quaternion)),
+ new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Quaternion)),
values => Quaternion.Euler((float)values[0], (float)values[1], (float)values[2])),
Description = "Euler angle rotation",
Flags = NodeFlags.AnimGraph | NodeFlags.VisualScriptGraph | NodeFlags.ParticleEmitterGraph,
@@ -607,7 +605,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 9,
Title = "String",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(string))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(string))),
Description = "Text",
Flags = NodeFlags.VisualScriptGraph | NodeFlags.AnimGraph,
Size = new Float2(200, 20),
@@ -658,7 +656,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 12,
Title = "Unsigned Integer",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(uint))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(uint))),
Description = "Constant unsigned integer value",
Flags = NodeFlags.AllGraphs,
Size = new Float2(170, 20),
@@ -698,7 +696,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 15,
Title = "Double",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(double))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(double))),
Description = "Constant floating point",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
@@ -716,7 +714,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 16,
Title = "Vector2",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Vector2))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Vector2))),
Description = "Constant Vector2",
Flags = NodeFlags.AllGraphs,
Size = new Float2(130, 60),
@@ -737,7 +735,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 17,
Title = "Vector3",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Vector3))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Vector3))),
Description = "Constant Vector3",
Flags = NodeFlags.AllGraphs,
Size = new Float2(130, 80),
@@ -760,7 +758,7 @@ namespace FlaxEditor.Surface.Archetypes
{
TypeID = 18,
Title = "Vector4",
- Create = (id, context, arch, groupArch) => new ConvertableNode(id, context, arch, groupArch, new ScriptType(typeof(Vector4))),
+ Create = (id, context, arch, groupArch) => new ConvertibleNode(id, context, arch, groupArch, new ScriptType(typeof(Vector4))),
Description = "Constant Vector4",
Flags = NodeFlags.AllGraphs,
Size = new Float2(130, 100),
diff --git a/Source/Editor/Surface/Archetypes/ConvertableNode.cs b/Source/Editor/Surface/Archetypes/ConvertibleNode.cs
similarity index 92%
rename from Source/Editor/Surface/Archetypes/ConvertableNode.cs
rename to Source/Editor/Surface/Archetypes/ConvertibleNode.cs
index e7c3c5517..a54c9e0d4 100644
--- a/Source/Editor/Surface/Archetypes/ConvertableNode.cs
+++ b/Source/Editor/Surface/Archetypes/ConvertibleNode.cs
@@ -9,15 +9,15 @@ using FlaxEngine;
namespace FlaxEditor.Surface.Archetypes;
///
-///
+/// A special type of node that adds the functionality to convert nodes to parameters
///
-internal class ConvertableNode : SurfaceNode
+internal class ConvertibleNode : SurfaceNode
{
- private ScriptType _type;
- private Func