public static Graph FromJson(string json, IGraphListener listener) { Graph g = JsonUtility.FromJson<Graph>(json); listener.OnCreate(g); g.RegisterListener(listener); return g; }
public void RegisterListener(IGraphListener listener) { this.listener = listener; foreach (var node in nodes) { node.RegisterListener(listener); } }
public static Graph FromJson(string json, IGraphListener listener) { Graph g = JsonUtility.FromJson <Graph>(json); listener.OnCreate(g); g.RegisterListener(listener); return(g); }
public static Graph Load(string fileName, IGraphListener listener) { if (File.Exists(fileName)) { var file = File.OpenText(fileName); var json = file.ReadToEnd(); file.Close(); return(FromJson(json, listener)); } else { Debug.Log("Could not Open the file: " + fileName); return(null); } }
public static Graph Load(string fileName, IGraphListener listener) { if(File.Exists(fileName)){ var file = File.OpenText(fileName); var json = file.ReadToEnd(); file.Close(); Graph deserializedGraph = FromJson(json, listener); if (deserializedGraph.Version != BonConfig.Version) { Debug.LogWarning("You loading a graph with a different version number: " + deserializedGraph.Version + " the current version is " + BonConfig.Version); } return deserializedGraph; } else { Debug.Log("Could not Open the file: " + fileName); return null; } }
public void RegisterListener(IGraphListener listener) { this.listener = listener; }
public void RegisterListener(IGraphListener listener) { this._listener = listener; foreach (var node in _nodes) { node.RegisterListener(listener); } }
public BonLauncher() { _controller = new StandardGraphController(); _graphs = new List<Graph>(); }