diff --git a/Scripts/Node.cs b/Scripts/Node.cs
index a9191b3..b5b27ee 100644
--- a/Scripts/Node.cs
+++ b/Scripts/Node.cs
@@ -10,8 +10,6 @@ public abstract class Node {
/// Name of the node
public string name = "";
[NonSerialized] public NodeGraph graph;
- public string NodeType { get { return nodeType; } }
- [SerializeField] private string nodeType;
[SerializeField] public Rect position = new Rect(0,0,200,200);
[SerializeField] private NodePort[] inputs = new NodePort[0];
@@ -21,7 +19,6 @@ public abstract class Node {
public int OutputCount { get { return outputs.Length; } }
protected Node() {
- nodeType = GetType().ToString();
CachePorts();
Init();
}
@@ -60,12 +57,6 @@ public abstract class Node {
return new NodePort(name, type, this, NodePort.IO.Output);
}
- public void FinalizeDeserialization() {
- for (int i = 0; i < outputs.Length; i++) {
- outputs[i].FinalizeDeserialization();
- }
- }
-
public void ClearConnections() {
for (int i = 0; i < inputs.Length; i++) {
inputs[i].ClearConnections();
diff --git a/Scripts/NodeGraph.cs b/Scripts/NodeGraph.cs
index 4ceb107..eefff63 100644
--- a/Scripts/NodeGraph.cs
+++ b/Scripts/NodeGraph.cs
@@ -49,50 +49,6 @@ public class NodeGraph : ScriptableObject {
nodes.Clear();
}
- public string Serialize() {
- //Unity serializer doesn't support polymorphism, so we'll have to use a hack
- s_nodes = new string[nodes.Count];
- for (int i = 0; i < nodes.Count; i++) {
- s_nodes[i] = JsonUtility.ToJson(nodes[i]);
- }
- //s_nodes = new string[] { "" };
- string json = JsonUtility.ToJson(this);
- //json = json.Replace("\"\"", GetSerializedList(nodes));
- return json;
- }
-
- private string GetSerializedList(List list) {
- string[] s_list = new string[list.Count];
- for (int i = 0; i < list.Count; i++) {
- s_list[i] = JsonUtility.ToJson(list[i]);
- }
- return string.Join(",", s_list);
-
- }
-
- public static NodeGraph Deserialize(string json) {
- NodeGraph nodeGraph = JsonUtility.FromJson(json);
-
- //If we are trying to open a newly created nodegraph, it will be empty
- if (nodeGraph == null) nodeGraph = new NodeGraph();
- if (nodeGraph.s_nodes != null) {
-
- for (int i = 0; i < nodeGraph.s_nodes.Length; i++) {
- NodeTyper tempNode = new NodeTyper();
- JsonUtility.FromJsonOverwrite(nodeGraph.s_nodes[i], tempNode);
- //Node node = nodeGraph.AddNode(tempNode.nodeType);
- Type type = Type.GetType(tempNode.nodeType);
- Node node = JsonUtility.FromJson(nodeGraph.s_nodes[i], type) as Node;
- nodeGraph.AddNode(node);
- }
- }
- if (nodeGraph.nodes != null){
- for (int i = 0; i < nodeGraph.nodes.Count; i++) {
- nodeGraph.nodes[i].FinalizeDeserialization();
- }
- }
- return nodeGraph;
- }
private class NodeTyper {
public string nodeType = "Node";