public void Load() { engine = new SharpScript(); engine.CompileCode(Template.Code, new InterfaceInteraction(this, spriteBatch, this.PlayerEntity)); engine.Invoke("Initialize"); }
public void Load(string loc) { script = new SharpScript(); try { string location = Environment.CurrentDirectory + "\\Scripts\\Logic\\" + loc + (loc.EndsWith(".cs") ? "" : ".cs"); name = loc.Split('0')[0]; string code = File.ReadAllText(location); script.CompileCode(code); script.Invoke("Load", this); Console.WriteLine("s_0: " + s_0); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("-- Error (" + e.GetType() + "): " + e.Message); Console.ResetColor(); } }