Ejemplo n.º 1
0
        private void InitLua()
        {
            lua.AddLoader(Loader.Create());
            string luaCode;

            if (string.IsNullOrEmpty(CustomSearchPath))
            {
                luaCode = @"package.path=package.path .. " + $"';{GameConf.LUA_BASE_PATH}?.lua;{Application.persistentDataPath}?.lua;{Application.streamingAssetsPath}?.lua;'";
            }
            else
            {
                GameConf.CustomLuaGame = CustomSearchPath;
                luaCode = $"package.path=package.path ..';{GameConf.LUA_BASE_PATH}?.lua;{CustomSearchPath}?.lua;{Application.persistentDataPath}?.lua;{Application.streamingAssetsPath}?.lua;'";
            }

            lua.DoString(luaCode);

            lua.Global.Set("ResourceManager", ResourceManager.Get());
            lua.Global.Set("LooperManager", LooperManager.Get());
            lua.DoString("BabyEngine = BabyEngine or {}\nrequire('framework.init')");
        }
Ejemplo n.º 2
0
 private void Awake()
 {
     Instance = this;
 }