Created
September 9, 2011 20:15
-
-
Save bamboo/1207210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityScript.Scripting; | |
namespace Evaluator | |
{ | |
public class Test | |
{ | |
private static EvaluationContext context = new EvaluationContext(); | |
public static void Run() | |
{ | |
for (var i = 1; i < 5; ++i) | |
Eval(string.Format("var f = function() {{ print('and {0}'); }}; f();", i)); | |
} | |
public static void Eval(string code) | |
{ | |
UnityScript.Scripting.Evaluator.Eval(context, code); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment