Beispiel #1
0
    // Use this for initialization
    void Awake()
    {
        _luaHotfix = this;
        _luaEnv    = new LuaEnv();
        _luaEnv.AddLoader((ref string filename) => {
            //lua customer path
            filename = Util.PersistentDataPath + "lua/game/" + filename + ".lua";
            return(File.ReadAllBytes(filename));

            /***
             * string script= File.ReadAllText(filename);
             * return System.Text.Encoding.UTF8.GetBytes(script);
             ***/
        });
    }
Beispiel #2
0
 void OnDestroy()
 {
     _luaEnv    = null;
     _luaHotfix = null;
 }