void OnDestroy() { if (iCalc != null) { iCalc.OnDestroy(); } iCalc = null; }
void Awake() { LuaEnv luaEnv = LuaHotfix.Instance.luaEnv; luaEnv.DoString("require '" + luaModel + "'", luaModel); LuaBehaviourCalc calc_new = luaEnv.Global.GetInPath <LuaBehaviourCalc> ("new_lua_mono"); iCalc = calc_new(luaModel, this); //constructor iCalc.Awake(); }