LogicEditor | Singleton Nodes do not initialize with a visible ScriptID
Summary
When creating nodes that derive from LogicNodeSingleton.cs
, these do not get initialized with a LogicNodeId
, which is why the label for that is not shown (see screencast).
When a graph update is triggered, e.g. by creating a totally unrelated edge somewhere else in the graph, the id gets set correctly and the label shown.
Steps to reproduce
- Create a singleton node, e.g.
Click (Singleton)
- No
LogicNodeId
label is shown - Getting the debug of the node shows that no
LogicNodeId
is set at all - Create an edge somewhere in the graph
- The
LogicNodeId
label will be shown and debug will show that the id is set
What is the current bug behavior?
I'm not sure if this has any consequences at all, but i would assume so. Maybe these are related to edges of the graph sometimes going missing (#44)?
What is the expected correct behavior?
Singleton Nodes should correctly initialize with a LogicNodeId
Version
0.4.3-preview and 1.1 of the logic editor
Build Target
N/A
Mode
N/A
Relevant logs and/or screenshots
Possible fixes
I think singletons try to create a syncvariable for the LogicNodeId
as well so as to be able to sync the node state across duplicate nodes. This uses GetIdForField(string fieldName)
in ExtendedBaseNode_GeneralMethods.cs
, which in turn tries to use the GameObjectId
to create a unique id for the singleton sync variable. New nodes typically do not have an edge connecting them to a GameObjectId, so maybe the issue could be found here?
Needs further research.