void Awake() { DontDestroyOnLoad(gameObject); instance = this; this.luaMain = "return require(\"" + enterLua + "\") \n"; luacache = new Dictionary <string, byte[]>(); svr = new LuaSvr(); LuaState.loaderDelegate = Loader; }
void OnDestroy() { if (onDestroyFn != null) { onDestroyFn.call(); } svr = null; instance = null; luacache.Clear(); }