public static void InitLibraries(LuaVM vm)
 {
     UnityOs.InitLuaModule(vm);
     ModifiersManager.InitLuaModule();
     ChunkFinder.InitLuaModule();
     SimpleOrderManager.InitLuaModule();
     GameMoveManager.InitLuaModule();
     AI_Calculation.InitLuaModule();
     PathCalcManager.InitLuaModule();
     FlagManager.InitLuaModule();
     ProgressUnitBar.InitLuaModule();
     LuaChunkManager.InitLuaModule();
     ErrorBar_HTML.InitLuaModule();
     LuaHelper.InitLuaModule();
     ResearchManager.InitLuaModule();
 }
Beispiel #2
0
        void Awake()
        {
            Script.DefaultOptions.ScriptLoader = new UnityAssetsScriptLoader();


            Vm = new LuaVM(CoreModules.Preset_Complete, new string[]
            {
                "Assets/Resources/Scripts/LuaScripts/?",
                "Assets/Resources/Scripts/LuaScripts/?.txt",
                "Resources/Scripts/LuaScripts/?",
                "Resources/Scripts/LuaScripts/?.txt",
                "Scripts/LuaScripts/?",
                "Scripts/LuaScripts/?.txt",

                "Assets/Resources/Scripts/LuaScripts/?/?",
                "Assets/Resources/Scripts/LuaScripts/?/?.txt",
                "Resources/Scripts/LuaScripts/?/?",
                "Resources/Scripts/LuaScripts/?/?.txt",
                "Scripts/LuaScripts/?/?",
                "Scripts/LuaScripts/?/?.txt",

                "Assets/Resources/Scripts/LuaScripts/?/?/?",
                "Assets/Resources/Scripts/LuaScripts/?/?/?.txt",
                "Resources/Scripts/LuaScripts/?/?/?",
                "Resources/Scripts/LuaScripts/?/?/?.txt",
                "Scripts/LuaScripts/?/?/?",
                "Scripts/LuaScripts/?/?/?.txt",
            });
            ScriptObj = Vm.GetScriptObject();

            LuaLibrariesIniter.InitLibraries(Vm);

            //UnityOs.IsDebugCheck = true;

            var fileText  = UnityOs.GetTextFromFile("main");
            var EvoEngine = Vm.ExecuteString(fileText);
            var main      = EvoEngine.Table.Get("Main");

            InitForLua();

            Vm.Call(main);
        }