Beispiel #1
0
        private void LoadLuaScript()
        {
            string luaPath = String.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath());

            directorScript = LuaEngine.LoadScript(luaPath);
            if (directorScript == null)
            {
                Program.Log.Error("Could not find script for director {0}.", GetName());
            }
        }
Beispiel #2
0
 private List <LuaParam> CallLuaScript(string funcName, params object[] args)
 {
     if (directorScript != null)
     {
         directorScript = LuaEngine.LoadScript(String.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath));
         if (!directorScript.Globals.Get(funcName).IsNil())
         {
             DynValue        result  = directorScript.Call(directorScript.Globals[funcName], args);
             List <LuaParam> lparams = LuaUtils.CreateLuaParamList(result);
             return(lparams);
         }
         else
         {
             Program.Log.Error("Could not find script for director {0}.", GetName());
         }
     }
     return(null);
 }