Example #1
0
 static public int LoadBundle(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(SLua.LuaFunction)))
         {
             PLua             self = (PLua)checkSelf(l);
             SLua.LuaFunction a1;
             checkType(l, 2, out a1);
             self.LoadBundle(a1);
             return(0);
         }
         else if (matchType(l, argc, 2, typeof(bool)))
         {
             PLua           self = (PLua)checkSelf(l);
             System.Boolean a1;
             checkType(l, 2, out a1);
             self.LoadBundle(a1);
             return(0);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #2
0
 static public int DoUnity3dLua(IntPtr l)
 {
     try {
         PLua self = (PLua)checkSelf(l);
         self.DoUnity3dLua();
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #3
0
 static public int RegisterFunc(IntPtr l)
 {
     try {
         PLua self = (PLua)checkSelf(l);
         self.RegisterFunc();
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #4
0
 static public int get_updateFn(IntPtr l)
 {
     try {
         PLua self = (PLua)checkSelf(l);
         pushValue(l, self.updateFn);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #5
0
 static public int Log_s(IntPtr l)
 {
     try {
         System.Object a1;
         checkType(l, 1, out a1);
         PLua.Log(a1);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #6
0
 static public int StopDelay_s(IntPtr l)
 {
     try {
         System.String a1;
         checkType(l, 1, out a1);
         PLua.StopDelay(a1);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #7
0
 static public int Loader_s(IntPtr l)
 {
     try {
         System.String a1;
         checkType(l, 1, out a1);
         var ret = PLua.Loader(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #8
0
 static public int set_updateFn(IntPtr l)
 {
     try {
         PLua             self = (PLua)checkSelf(l);
         SLua.LuaFunction v;
         checkType(l, 2, out v);
         self.updateFn = v;
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #9
0
 static public int set_ChatNet(IntPtr l)
 {
     try {
         PLua self = (PLua)checkSelf(l);
         LNet v;
         checkType(l, 2, out v);
         self.ChatNet = v;
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #10
0
    void LuaBegin()
    {
        //Debug.Log("LuaBegin");
        PLua luab = this.gameObject.GetComponent <PLua>();

        if (luab == null)
        {
            PLua.isDebug  = editorDebug;
            PLua.enterLua = this.enterLua;
            PLua p = gameObject.AddComponent <PLua>();
        }
        else if (luab.enabled == false)
        {
            luab.enabled = true;
        }
    }
Example #11
0
    //开始加载场景
    internal static void BeginLoadScene(string beginLua)
    {
        ManifestManager.LoadUpdateFileManifest(null);
        PLua.DestoryLua();
        PLua.enterLua = beginLua;
        CUtils.DebugCastTime("LoadingFirst");
        var req = CRequest.Get();

        req.relativeUrl = CUtils.GetRightFileName(sceneAssetBundleName);
        req.assetName   = sceneName;
        req.OnComplete  = OnSceneAbLoaded;
        req.OnEnd       = OnSceneAbError;
        req.assetType   = CacheManager.Typeof_ABScene;
        req.async       = true;
        ResourcesLoader.LoadAsset(req);
        ResourcesLoader.OnAssetBundleComplete = OnSharedComplete;
    }
Example #12
0
 static public int Delay_s(IntPtr l)
 {
     try {
         SLua.LuaFunction a1;
         checkType(l, 1, out a1);
         System.Single a2;
         checkType(l, 2, out a2);
         System.Object a3;
         checkType(l, 3, out a3);
         PLua.Delay(a1, a2, a3);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #13
0
 void OnDestroy()
 {
     if (onDestroyFn != null) onDestroyFn.call();
     updateFn = null;
     if (lua != null) lua.luaState.Close();
     lua = null;
     _instance = null;
     if(net!=null)net.Dispose();
     net = null;
     if(ChatNet!=null)ChatNet.Dispose();
     ChatNet = null;
     luacache.Clear();
 }
Example #14
0
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     luacache = new Dictionary<string, TextAsset>();
     lua = new Lua();
     _instance = this;
     LoadScript();
 }
Example #15
0
 void OnDestroy()
 {
     if (onDestroyFn != null) onDestroyFn.call();
     updateFn = null;
     lua = null;
     _instance = null;
     luacache.Clear();
 }