コード例 #1
0
 private void Btn_DaoRu()             // 点击导入
 {
     MyOpenFileOrFolder.OpenFile(Ctrl_UserInfo.Instance.DaoRuFirstPath, "选择1个或多个 集合图片", EFileFilter.TuAndAll,
                                 (filePaths) =>
     {
         List <FileInfo> list = new List <FileInfo>(filePaths.Length);
         foreach (string filePath in filePaths)
         {
             FileInfo file = new FileInfo(filePath);
             if (MyFilterUtil.IsTu(file))
             {
                 list.Add(file);
             }
         }
         MyEventCenter.SendEvent(E_GameEvent.DaoRuTuFromFile, EGameType.JiHeTu, (ushort)mCurrentIndex, list, true);
     });
 }
コード例 #2
0
    IEnumerator LoadFileAndFolder(DirectoryInfo[] foloderList, DirectoryInfo currentDic)       // 加载文件和文件夹
    {
        for (int i = 0; i < foloderList.Length; i++)
        {
            if (foloderList[i].Parent != null)
            {
                AddMiddleButton(foloderList[i], MiddleButtonType.Folder);       // 有父文件夹的是文件夹
            }
            else
            {
                AddMiddleButton(foloderList[i], MiddleButtonType.Drive);         // 没有的就是磁盘啊
            }
            yield return(0);
        }

        if (!isOnlyShowFolder)
        {
            FileInfo[] files = mFileBrowser.GetFiles();   // 获得所有文件
            foreach (FileInfo fileInfo in files)
            {
                if (MyFilterUtil.IsAudio(fileInfo))
                {
                    AddMiddleButton(fileInfo, MiddleButtonType.Music);
                }
                else
                {
                    Transform t = AddMiddleButton(fileInfo, MiddleButtonType.File);
                    if (MyFilterUtil.IsTu(fileInfo))          // 是图片那就加载图片
                    {
                        InitMoBan_Tu(t, fileInfo);
                    }
                }
                yield return(new WaitForEndOfFrame());
            }
        }


        if (null == currentDic)
        {
            AddMiddleButton(null, MiddleButtonType.ZhuoMain);       // 桌面
        }
    }
コード例 #3
0
 private void Btn_OnDaoRu()                 // 点击导入
 {
     MyOpenFileOrFolder.OpenFile(Ctrl_UserInfo.Instance.DaoRuFirstPath, "选择多个文件(序列图)", EFileFilter.TuAndAll,
                                 (filePaths) =>
     {
         List <FileInfo> fileInfos = new List <FileInfo>(filePaths.Length);
         foreach (string filePath in filePaths)
         {
             FileInfo fileInfo = new FileInfo(filePath);
             if (MyFilterUtil.IsTu(fileInfo))
             {
                 fileInfos.Add(fileInfo);
             }
             else
             {
                 MyLog.Red("选择了其他的格式文件 —— " + fileInfo.Name);
             }
         }
         MyEventCenter.SendEvent(E_GameEvent.DaoRuTuFromFile, EGameType.XuLieTu222, (ushort)mCurrentIndex, fileInfos, true);
     });
 }
コード例 #4
0
    //—————————————————— 最右边 ——————————————————


    private void Btn_DaoRu()                           // 点击导入
    {
        MyOpenFileOrFolder.OpenFile(Ctrl_DaoRuInfo.Instance.DaoRuFirstPath, "选择多个文件(序列图)", EFileFilter.TuAndAll,
                                    (filePaths) =>
        {
            List <FileInfo> fileInfos = new List <FileInfo>(filePaths.Length);
            foreach (string filePath in filePaths)
            {
                FileInfo fileInfo = new FileInfo(filePath);
                if (MyFilterUtil.IsTu(fileInfo))
                {
                    fileInfos.Add(fileInfo);
                }
                else
                {
                    MyLog.Red("选择了其他的格式文件 —— " + fileInfo.Name);
                }
            }
            MyEventCenter.SendEvent(E_GameEvent.RealyDaoRu_File, EDuoTuInfoType.SearchShow, mCurrentBigIndex, mCurrentBottomIndex, fileInfos);
        });
    }