Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. string expression = "2+2";
  2.  
  3. public string evaluateExpresion(expression)
  4. {
  5. return executeJavascript(expression); // Magic javascript executor
  6. }
  7.  
  8. Debug.Log(evaluateExpression(expression);
  9.  
  10. // JavaScriptExpressions.js
  11.  
  12. function executeExpression( x : string ) {
  13. // Some code here..
  14. }
  15.  
  16. // YourCsharp.cs
  17. string expression = "2+2";
  18.  
  19. public string evaluateExpresion(string expression) {
  20. return transform.GetComponent<JavaScriptExpressions>().executeExpression(expression);
  21. }
  22.  
  23. Debug.Log(evaluateExpression(expression));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement