Example #1
0
        public static void DoIt()
        {
            Filter <Type> baseFilter = new GeneralFilter <Type> (ToLuaMenu.baseType);
            Filter <Type> dropFilter = new GeneralFilter <Type> (ToLuaMenu.dropType);
            string        dirPath    = "LuaAPI";

            if (Directory.Exists(dirPath))
            {
                Directory.Delete(dirPath, true);
            }
            var directory  = Directory.CreateDirectory(dirPath);
            var collection = new BindTypeCollection(CustomSettings.customTypeList);
            var bindTypes  = collection.CollectBindType(baseFilter, dropFilter);

            foreach (var bindType in bindTypes)
            {
                var generator = new LuaAPIGenerator();
                generator.Gen(bindType);
            }

            string[] removes = { "/View.lua" };
            for (int i = 0; i < removes.Length; i++)
            {
                if (File.Exists(directory.FullName + removes [i]))
                {
                    File.Delete(directory.FullName + removes [i]);
                }
            }

            Debug.LogFormat("API 生成完毕. {0}", directory.FullName);
        }
        static void DoIt()
        {
            Filter <Type> baseFilter = new GeneralFilter <Type>(ToLuaMenu.baseType);
            Filter <Type> dropFilter = new GeneralFilter <Type>(ToLuaMenu.dropType);

            var collection = new BindTypeCollection(CustomSettings.customTypeList);
            var bindTypes  = collection.CollectBindType(baseFilter, dropFilter);

            foreach (var bindType in bindTypes)
            {
                var generator = new LuaAPIGenerator();
                generator.Gen(bindType);
            }
        }
Example #3
0
        static void DoIt()
        {
            Filter <Type> baseFilter = new GeneralFilter <Type>(ToLuaMenu.baseType);
            Filter <Type> dropFilter = new GeneralFilter <Type>(ToLuaMenu.dropType);
            var           directory  = Directory.CreateDirectory("LuaAPI");
            var           collection = new BindTypeCollection(CustomSettings.customTypeList);
            var           bindTypes  = collection.CollectBindType(baseFilter, dropFilter);

            foreach (var bindType in bindTypes)
            {
                var generator = new LuaAPIGenerator();
                generator.Gen(bindType);
            }
            Debug.LogFormat("API 生成完毕. {0}", directory.FullName);
        }