Beispiel #1
0
    public static void OnPostprocessAllAssets(string[] importedAsset, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        if (Application.isPlaying)
        {
            luaFiles.Clear();
            for (int i = 0; i < importedAsset.Length; i++)
            {
                bool isLuaFile = importedAsset[i].EndsWith(".lua");
                if (isLuaFile)
                {
                    string luaPath = importedAsset[i];

                    luaPath = luaPath.Substring(assetBundlePath.Length, luaPath.Length - assetBundlePath.Length);
                    luaPath = luaPath.Replace(".lua", "");
                    luaFiles.Add(luaPath);
                }
            }
            if (luaFiles.Count > 0)
            {
                EditorUtility.DisplayProgressBar("HotUpdateLua", "", 0);
                try
                {
                    LuaRoot.HotUpdate(luaFiles);
                    Debug.Log("LuaHotUpdate:" + string.Join(",", luaFiles.ToArray()));
                }
                catch (Exception e)
                {
                    Debug.LogException(e);
                }

                luaFiles.Clear();
                EditorUtility.ClearProgressBar();
            }
        }
    }
Beispiel #2
0
 void Start()
 {
     /// Log初始化
     m_CustomLogHandler = new CustomLogHandler();
     /// 网络初始化
     NetManager.Instance.Init();
     /// Lua初始化
     LuaRoot.Init();
 }
Beispiel #3
0
	static int get_Lua(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LuaRoot obj = (LuaRoot)o;
			LuaInterface.LuaState ret = obj.Lua;
			ToLua.PushObject(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index Lua on a nil value");
		}
	}
Beispiel #4
0
	static int get_LayerList(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LuaRoot obj = (LuaRoot)o;
			System.Collections.Generic.List<UnityEngine.GameObject> ret = obj.LayerList;
			ToLua.PushSealed(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index LayerList on a nil value");
		}
	}
Beispiel #5
0
	static int get_UIRoot(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LuaRoot obj = (LuaRoot)o;
			UnityEngine.GameObject ret = obj.UIRoot;
			ToLua.PushSealed(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index UIRoot on a nil value");
		}
	}
Beispiel #6
0
	static int set_LayerList(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LuaRoot obj = (LuaRoot)o;
			System.Collections.Generic.List<UnityEngine.GameObject> arg0 = (System.Collections.Generic.List<UnityEngine.GameObject>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List<UnityEngine.GameObject>));
			obj.LayerList = arg0;
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index LayerList on a nil value");
		}
	}
Beispiel #7
0
	static int set_UIRoot(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LuaRoot obj = (LuaRoot)o;
			UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
			obj.UIRoot = arg0;
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index UIRoot on a nil value");
		}
	}
Beispiel #8
0
 void OnDestroy()
 {
     LuaRoot.OnDestroy();
 }
Beispiel #9
0
 void Update()
 {
     NetManager.Instance.Update();
     LuaRoot.Update();
 }
Beispiel #10
0
 void Awake()
 {
     _instance = this;
 }