public static LuaPlug GetInstance() { if (mInstance == null) { mInstance = new LuaPlug(); } return(mInstance); }
//初始化函数,可以被重写,已添加其他 protected virtual bool Init() { mSelfLuaTable = LuaPlug.GetInstance().addLuaFile(LuaPath, gameObject); LuaClassName = CallLuaFunctionRString("getClassName"); mSelfLuaTable["gameObject"] = gameObject; mSelfLuaTable["transform"] = transform; // if (gameObject.GetComponent<Button>() != null) // { // gameObject.GetComponent<Button>().onClick.AddListener( // onClick // ); // } return(true); }
public static void Dispose() { mInstance = null; if (luaCoroutine != null) { GameObject.Destroy(luaCoroutine); } if (mLuaState != null) { mLuaState.Dispose(); mLuaState = null; } // UnityEngine.SceneManagement.SceneManager.LoadScene ("ARBookFramework_BookMenu"); // LuaPlug.assetBundleLoaded = false; // LuaPlug.getDisposeInstance().Destroy (); }
public void InitPlug() { plug = LuaPlug.GetInstance(); plug.Init(); }