You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may be missing something obvious, but it doesn't seem like the Klak system is geared up to creating Node Graphs via scripting, and it's always linked to the Editor Window objects?
I've inspected the EditorWindow stuff and can see how it should be possible to create scripts to do this, but it would be lovely to see an example of Creating a Klak graph using some C# scripting.
The logic for creating Nodes seems to be in GraphGUI.cs, which is fine, but I'd love to do the same and create connections via scripting if possible, to allow runtime changes to be made to the Klak graph.
void CreateMenuItemCallback(object data)
{
var type = data as Type;
// Create a game object.
var name = ObjectNames.NicifyVariableName(type.Name);
var gameObject = new GameObject(name);
var nodeRuntime = (Wiring.NodeBase)gameObject.AddComponent(type);
gameObject.transform.parent = ((Graph)graph).patch.transform;
// Add it to the graph.
var node = Node.Create(nodeRuntime);
node.position = new Rect((Vector2)m_contextMenuMouseDownPosition, Vector2.zero);
node.Dirty();
graph.AddNode(node);
// Select the new node.
ClearSelection();
selection.Add(node);
UpdateUnitySelection();
// Make it undo-able.
Undo.RegisterCreatedObjectUndo(gameObject, "New Node");
}
The text was updated successfully, but these errors were encountered:
I may be missing something obvious, but it doesn't seem like the Klak system is geared up to creating Node Graphs via scripting, and it's always linked to the Editor Window objects?
I've inspected the EditorWindow stuff and can see how it should be possible to create scripts to do this, but it would be lovely to see an example of Creating a Klak graph using some C# scripting.
The logic for creating Nodes seems to be in GraphGUI.cs, which is fine, but I'd love to do the same and create connections via scripting if possible, to allow runtime changes to be made to the Klak graph.
The text was updated successfully, but these errors were encountered: