I’m just getting started with FlowCanvas, so I’m sure I’m missing something, but I can’t figure out how to edit the case elements in the Switch Integer node. It shows with the out ports of 0, 1, 2, 3 and Default. I’d like to edit those out port numbers to be something like 0, 57, 65 — or even better, a reference to a variable. Is this possible? I see that the Switch String node has a Cases section shown in the Canvas inspector, but the Switch Integer node does not, see attached screenshot.
To be clear, the C# code i’m trying to replicate is:
1
2
3
4
5
6
switch(e.value){
case0:/* do something */break;
casemyVar.intField:/* do something */break;
casemyOtherVar.intField:/* do something */break;
default:/* do something */break;
}
Perhaps there’s a better node for this purpose? Any guidance is appreciated. I’m using Unity 2018.2.13f1 and FlowCanvas 2.9.0. Thank you!
Hello and sorry for the late reply (my brother got married)!
I have attached for you here a new node “Switch Integer Custom”, which will allow you to specify the int cases.
The only reason this is not already done on the existing SwitchInteger node, is due to backwards compatibility by the way. Such legacy nodes, will though be most than probably removed in v3 and only keep the new ones around (like the one attached).
Hey Gavalakis, thank you for the response, and no worries — life comes first! Congrats to your brother.
That code works great for specifying the integer, and I was able to use it as a template to write my own to switch on my own variable type, which is what I ultimately wanted, so thank you very much! Good work on this product.
When v3 comes out will it break my existing FlowScripts? If so, and if v3 is coming out within the next month, I’d like to know so I can stop working on this portion of my project and focus on something else while waiting for the update.
Hey Sean,
Sorry for the late reply once again. Thank you!
V3 will not break v2.x flowScripts and graphs will stay backwards compatible.
I plan v3 to be released somewhere around christmas.
Thank you!
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.