Skip to content

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

  1. Create a singleton node, e.g. Click (Singleton)
  2. No LogicNodeId label is shown
  3. Getting the debug of the node shows that no LogicNodeId is set at all
  4. Create an edge somewhere in the graph
  5. 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

singletonID

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.