- Home /
Math Parsers for Unity 5.1.4 and .NET 2.0 or Mono for Unity
Has anybody used Math Parsers with Unity before. I tried several but they don't seem to be compatible with .NET 2.0?
On the other hand is there some build in function to calculate mathematical expressions like:
"2 + 3 * 5 - 4" = 13
More info here: http://stackoverflow.com/questions/34364856/how-to-structure-program-that-calculates-math-expression
Comment
Best Answer
Answer by spinnerbox · Dec 20, 2015 at 01:20 PM
This is made by some Alek: http://mono.1490590.n4.nabble.com/Javascript-eval-function-in-c-td1490783.html
It uses variant of the eval() function. It works. Try: Debug.Log(Evaluator.eval("2 + 3 * 5 - 4")); it prints 13.