示例#1
0
        public static LuaPlug GetInstance()
        {
            if (mInstance == null)
            {
                mInstance = new LuaPlug();
            }

            return(mInstance);
        }
示例#2
0
        //初始化函数,可以被重写,已添加其他
        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);
        }
示例#3
0
        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 ();
        }
示例#4
0
 public void InitPlug()
 {
     plug = LuaPlug.GetInstance();
     plug.Init();
 }