Beispiel #1
0
 /// <summary>
 /// Asynchronously loads a string containing a Lua/MoonSharp function.
 ///
 /// This method is supported only on .NET 4.x and .NET 4.x PCL targets.
 /// </summary>
 /// <param name="script">The script.</param>
 /// <param name="code">The code.</param>
 /// <param name="globalTable">The global table to bind to this chunk.</param>
 /// <param name="funcFriendlyName">Name of the function used to report errors, etc.</param>
 /// <returns>
 /// A DynValue containing a function which will execute the loaded code.
 /// </returns>
 public static Task <DynValue> LoadFunctionAsync(this Script script, string code, Table globalTable = null, string funcFriendlyName = null)
 {
     return(ExecAsync(() => script.LoadFunction(code, globalTable, funcFriendlyName)));
 }