Пример #1
0
    //------------------------------------------------------------------------------------------------------------------
    //
    // 打包升级用资源
    //
    //--------------------------------------------------------------------------------------------
    // 打包升级用资源
    void OnLyrPackUpdate(BuildPackWindow src, float fx, float fy)
    {
        string verPth = "PackVers/";

        if (GUI.Button(new Rect(fx + 355, fy, 40, 20), @"比较"))
        {
            NtfCompare(src);
        }

        float fw = 335;

        GUI.Label(new Rect(fx, fy + 25, fw, 20), @"基础版本: " + mfCsv0);
        if (GUI.Button(new Rect(fx + fw + 20, fy + 25, 40, 20), @"查找"))
        {
            string fl = EditorUtility.OpenFilePanel(@"源版本文件", verPth, "csv");
            if (fl.Length > 0)
            {
                mfCsv0 = ArchiveUtil.NtfPathBeginPackVers(fl);
                NtfCompare(src);
            }
        }

        GUI.Label(new Rect(fx, fy + 50, fw, 20), @"比对版本: " + mfCsv1);
        if (GUI.Button(new Rect(fx + fw + 20, fy + 50, 40, 20), @"查找"))
        {
            string fl = EditorUtility.OpenFilePanel(@"目标版本文件", verPth, "csv");
            if (fl.Length > 0)
            {
                mfCsv1 = ArchiveUtil.NtfPathBeginPackVers(fl);
                NtfCompare(src);
            }
        }

        mCmpView.OnDrawView(fx, fy + 75, mCmpFile.ToArray());
    }
Пример #2
0
    //--------------------------------------------------------------------------------------------
    public void NtfCompare(BuildPackWindow src)
    {
        if ((mfCsv0.Length > 0) && (mfCsv1.Length > 0))
        {
            VerItemMng vMng = src.mVerMng;
            vMng.NtfCompareItemGrpFile(mfCsv0, mfCsv1);
            src.GenCompareView(@"比较结果");

            RyCompareUtil pUtl = vMng.GetCompareUtl();
            mCmpFile.Clear();
            NtfAddCmpResult(ref mCmpFile, pUtl.mLstSrc);
            NtfAddCmpResult(ref mCmpFile, pUtl.mDifSrc);
        }
    }
Пример #3
0
    //------------------------------------------------------------------------------
    void OnClickBtnCompare(BuildPackWindow src)
    {
        string verPth = "PackVers/";
        string file1  = EditorUtility.OpenFilePanel(@"源版本文件", verPth, "csv");

        if (file1.Length > 0)
        {
            string file2 = EditorUtility.OpenFilePanel(@"目标版本文件", verPth, "csv");
            if (file2.Length > 0)
            {
                src.mVerMng.NtfCompareItemGrpFile(file1, file2);
                src.GenCompareView(@"比较结果");
            }
        }
    }
Пример #4
0
    //--------------------------------------------------------------------------------------------
    // 版本制作
    public Vector2 OnLyrVerTool(BuildPackWindow src, Vector2 vPos)
    {
        GUI.Box(new Rect(vPos.x, vPos.y, 340, 300), "");
        string [] ary = { @"版本信息", @"版本制作" };
        mCurPg = GUI.Toolbar(new Rect(vPos.x, vPos.y, 340, 20), mCurPg, ary);
        if (0 == mCurPg)
        {
            OnLyrVerInfor(src, vPos.x, vPos.y + 25);
        }
        else if (1 == mCurPg)
        {
            OnLyrMakeVerInfor(src, vPos.x, vPos.y + 25);
        }

        return(new Vector2(340, 300));
    }
Пример #5
0
    //------------------------------------------------------------------------------------------------------------------
    //
    // 将全部资源进行打包
    //
    //--------------------------------------------------------------------------------------------
    // 将全部资源进行打包
    void OnLyrPackClient(BuildPackWindow src, float fx, float fy)
    {
        if (GUI.Button(new Rect(fx, fy - 2, 40, 20), @"查找"))
        {
            string verPth = "PackVers/";
            string szf    = EditorUtility.OpenFilePanel(@"版本文件", verPth, "csv");
            if (szf.Length > 0)
            {
                mCsvFile.loadCsvFile(szf, true);
                src.GenViewData(mCsvFile, szf);
                GenFromCsv();
            }
        }

        mFixView.OnDrawView(fx, fy + 25, mFixFile.ToArray());
    }
Пример #6
0
 //------------------------------------------------------------------------------
 void OnClickBtnGenMD5(BuildPackWindow src)
 {
     if (mMD5List.Count > 0)
     {
         string verPth = "PackVers/";
         string fnm    = PackVerCfg.GenNextVer();
         string file   = EditorUtility.SaveFilePanel("Save Version", verPth, fnm, "csv");
         if (file.Length > 0)
         {
             src.mVerMng.GenItemGrp(file, mMD5List);
             PackVerCfg.NtfUpdateVer();
             src.mVerMng.NtfSearchPackVers();                // 刷新版本文件列表
             string msg = @"版本文件列表已生成, 保存于[" + file + "]";
             EditorUtility.DisplayDialog(@"版本文件生成", msg, "Ok");
         }
     }
 }
Пример #7
0
    //--------------------------------------------------------------------------------------------
    Vector2 OnLyrVerInfor(BuildPackWindow src, float fx, float fy)
    {
        GUI.Label(new Rect(fx, fy + 2, 150, 20), @"当前版本:" + PackVerCfg.GetCurVer());

        if (GUI.Button(new Rect(fx + 150, fy - 2, 50, 20), @"刷 新"))
        {
            src.mVerMng.NtfSearchPackVers();
        }

        GUI.Label(new Rect(fx + 210, fy + 2, 80, 20), @"版本文件列表:");
        List <string> sList = src.mVerMng.GetVerList();

        if (mViewList.OnDrawView(fx, fy + 20, sList.ToArray()))
        {
            string szf = src.GetVerFile(mViewList.mHitRow);
            mCsvFile.loadCsvFile(szf, true);
            src.GenViewData(mCsvFile, szf);
        }

        return(new Vector2(340, 280));
    }
Пример #8
0
    //------------------------------------------------------------------------------
    // 版本制作
    Vector2 OnLyrMakeVerInfor(BuildPackWindow src, float fx, float fy)
    {
        if (GUI.Button(new Rect(fx, fy - 2, 70, 20), @"设置目录"))
        {
            string sel = EditorUtility.OpenFolderPanel("Search Files", Application.dataPath, "");
            if (sel.Length > 0)
            {
                mMD5List.Clear();
                mMD5List = null;
                mMD5List = ArchiveUtil.NtfGetFiles(sel, true, ArchiveUtil.mSkips);
            }
        }
        if (GUI.Button(new Rect(fx + 75, fy - 2, 40, 20), @"生成"))
        {
            OnClickBtnGenMD5(src);
        }
        if (GUI.Button(new Rect(fx + 115, fy - 2, 40, 20), @"比对"))
        {
            OnClickBtnCompare(src);
        }

        string szTxt = "";

        if (ArchiveUtil.mArMsg.Length > 0)
        {
            szTxt = ArchiveUtil.mArMsg;
        }
        else if (mMD5List != null)
        {
            szTxt = @"选中文件: " + mMD5List.Count;
        }
        GUI.Label(new Rect(fx + 220, fy + 2, 150, 20), szTxt);

        if (mMD5List != null)
        {
            mMD5View.OnDrawView(fx, fy + 20, mMD5List.ToArray());
        }
        return(new Vector2(340, 280));
    }
Пример #9
0
 //--------------------------------------------------------------------------------------------
 public Vector2 OnLayout(BuildPackWindow src, float fx, float fy)
 {
     GUI.Box(new Rect(fx, fy, 400, 300), "");
     return(new Vector2(400, 300));
 }