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
Currently, to detect changes to an individual input, you have to subscribe to a delegate. You can also receive a callback whenever any of the inputted values change.
This API proposal adds a Boolean property to the inputs to a node that can be acted on in the OnInputChanged() callback.
Example
publicclassDemoNode:Node{publicInputSocketTarget;publicInputSocketStatIncrease;public INodeInstance Create(){returnnew DemoNodeInstance();}publicclassDemoNodeInstance:Instance{publicInput<Character>Target;publicInput<int>StatIncrease;publicoverride InputMap[]Inputs(GraphConnectorconnections)=new[]{
connections.Create(ref Node.Target,ref Target)}publicoverridevoidSetup(){// Subscribe to events, setup variables...}publicoverridevoidOnInputChanged(){if(StatIncrease.HasChanged){
Console.WriteLine($"New Stat Value: {StatIncrease.Value}.");}if(Target.HasChanged){
Console.WriteLine($"New Target Value: {Target.Value}.");}}publicoverridevoidRemove(){// Unsubscribe from events, dispose members...}}}
Implementation
This Boolean flag indicating whether the value of the connection has changed should live on the connection itself.
Buffering events will allow this API to be much more useful.
The text was updated successfully, but these errors were encountered:
Currently, to detect changes to an individual input, you have to subscribe to a delegate. You can also receive a callback whenever any of the inputted values change.
This API proposal adds a Boolean property to the inputs to a node that can be acted on in the
OnInputChanged()
callback.Example
Implementation
This Boolean flag indicating whether the value of the connection has changed should live on the connection itself.
Buffering events will allow this API to be much more useful.
The text was updated successfully, but these errors were encountered: