Skip to content

Instantly share code, notes, and snippets.

@bamboo
Created September 9, 2011 20:15
Show Gist options
  • Save bamboo/1207210 to your computer and use it in GitHub Desktop.
Save bamboo/1207210 to your computer and use it in GitHub Desktop.
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