protectedoverridestring[]GetTargetEvents(){returnnull;}//you don't need this in this case.
protectedoverridevoidRegisterPorts(){
raised=AddFlowOutput("Out");
}
publicoverridevoidOnGraphStarted(){
base.OnGraphStarted();//make sure to call base
target.value.Tapped+=EventRaised;
}
publicoverridevoidOnGraphStoped(){
base.OnGraphStoped();//make sure to call base
target.value.Tapped-=EventRaised;
}
voidEventRaised(){
raised.Call(newFlow());
}
}
}
Notice that here, we instead derive from the generic class of EventNode, with an type argument of the type we need.
‘target.value’ gives you the actual component which is always the same type as the generic argument.
As with all the other event nodes, you can either leave the field in the node inspector empty to get the component automaticaly from the FlowScriptController gameobject, or you can assign a reference manualy.
Let me know if this works for you.
Thanks
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.