Esempio n. 1
0
    void CleanClient()
    {
        var files = Directory.GetFiles(ExcelExporterUtil.GetClientClassOutputPath());

        for (int i = 0; i < files.Length; i++)
        {
            var fileName = Path.GetFileName(files[i]);
            if (fileName.StartsWith("Cfg") && fileName.EndsWith(".cs"))
            {
                File.Delete(files[i]);
            }
        }

        files = Directory.GetFiles(ExcelExporterUtil.GetClientDataOutputPath());
        for (int i = 0; i < files.Length; i++)
        {
            var fileName = Path.GetFileName(files[i]);
            if (fileName.EndsWith(".bytes"))
            {
                File.Delete(files[i]);
            }
        }
        ExcelTextClassGenerater.GenerateClientClassFactory(ExcelExporterUtil.GetClientDataOutputPath(), ExcelExporterUtil.GetClientClassOutputPath() + "Base/", true);

        AssetDatabase.Refresh();
    }
Esempio n. 2
0
    void GenerateSelectedData()
    {
        if (_selectFiles.Count == 0)
        {
            Debug.LogError("没有选中excel");
            return;
        }
        for (int i = 0; i < _selectFiles.Count; i++)
        {
            GenSingleClientData(_selectFiles[i]);
        }

        if (ExcelExporterUtil.exportType == ExcelDataExportType.Text)
        {
            //必须有这个文件
            ExcelTextClassGenerater.GenerateClientClassFactory(ExcelExporterUtil.GetClientDataOutputPath(), ExcelExporterUtil.GetClientClassOutputPath() + "Base/", false);
        }
        AssetDatabase.Refresh();
    }
Esempio n. 3
0
    public void GenerateClientScript()
    {
        var generater = ClassFactory.GetFactory(GeneraterFactoryType.Client).Create();

        generater.GenerateClass(ExcelExporterUtil.GetClientClassOutputPath(), ExcelExporterUtil.GetClientClassFileName(fileName), clientData);
    }