Hi Everyone,
Many members asked about being able to write small pieces of code to evaluate at runtime within actions, and today, I think I cracked the case!
Using Jurassic Javascript runtime interpretor, you can now write simple javascripts and it will be evaluated.
http://u3d.as/content/unify-community/jurassic-javascript-runtime-interpreter-for-unity/2tvNow, the big challenge I failed to solved until now was a way to reference the fsm variables, and I finally found the right balance, and it turns out it's not even complicated... this custom action is like less than 100 lines...
example:
$result = $My Float*2;
That works fine, wether you want to run it once, or every frame. Notice that even space is allowed 'My Float' will be properly parse and understood as a fsm variable name.
If you have a Fsm variable named "My variable", you simply need to prefix a '$' and it will work!!!!
You want to access global variables? simply prefix 2 $ signs like this:
$$MyGlobalVariableName = $$MyGlobalFloat + 1;
this prevents name clash ( cause you can have a local fsm variable with the exact same name as a global variable, and then I would not be able to know which one you want to use.
I haven't run any stress tests or benchmark nor published to the various platform to see how it performs, so this is really a toy at the moment
I'll build a wiki page soon, with some proper examples, but that is very straight forward really. you can even have if statements, etc etc
Bye,
Jean