unity插件推荐

[Unity 3d]Unity Standalone File

2019-06-15  本文已影响2人  雨落随风

GitHub 上的工程多如繁星,有些好的仓库,但凡不经意间错过了就很难找回,故稍作采撷,希望能帮助到有心人。
本文集以一个小的功能点为单位行文,也便于拾取罢!

简介:

笔者今天推荐的仓库叫 UnityStandaloneFileBrowser
这个仓库就不多做介绍了,工程中用过的人应该挺多的,就是一个文件选择窗啦。

功能:

使用:

// Open file 
//打开文件
var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "", false);

// Open file async
// 异步打开文件
StandaloneFileBrowser.OpenFilePanelAsync("Open File", "", "", false, (string[] paths) => {  });

// Open file with filter
// 带文件类型过滤的打开文件窗
var extensions = new [] {
    new ExtensionFilter("Image Files", "png", "jpg", "jpeg" ),
    new ExtensionFilter("Sound Files", "mp3", "wav" ),
    new ExtensionFilter("All Files", "*" ),
};
var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", extensions, true);

// Save file
//保存文件
var path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "", "");

// Save file async
//异步保存文件
StandaloneFileBrowser.SaveFilePanelAsync("Save File", "", "", "", (string path) => {  });

// Save file with filter
// 带文件类型过滤的文件保存窗
var extensionList = new [] {
    new ExtensionFilter("Binary", "bin"),
    new ExtensionFilter("Text", "txt"),
};
var path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "MySaveFile", extensionList);

演示:

Mac


Windows

Linux
image.png

Tips:

链接:

gkngkc/UnityStandaloneFileBrowser: A native file browser for unity standalone platforms

结语:

这个仓库网络推广的太多太多,但作为一个情怀也理应被收录吧!

扩展阅读:

本文集持续更新ing,喜欢记得点赞关注哦!

上一篇 下一篇

猜你喜欢

热点阅读