├── Documentation~ ├── Images │ ├── add_from_git_url.png │ ├── drag_from_explorer_upload.png │ ├── drag_from_project_upload.png │ ├── file_explorer_client.png │ ├── file_explorer_window.png │ ├── go_to_path_key.png │ ├── input_path.png │ ├── main_ui.png │ ├── package_manager.png │ ├── right_click_delete.png │ ├── right_click_download.png │ ├── right_click_refresh.png │ ├── right_click_upload.png │ ├── status_panel.png │ ├── status_panel_small.png │ └── status_panel_small2.png ├── RemoteFileExplorer.md └── TODO.md ├── Editor.meta ├── Editor ├── Logic.meta ├── Logic │ ├── Constants.cs │ ├── Constants.cs.meta │ ├── Manipulator.cs │ ├── Manipulator.cs.meta │ ├── TaskManager.cs │ └── TaskManager.cs.meta ├── RemoteFileExplorer.cs ├── RemoteFileExplorer.cs.meta ├── UI.meta ├── UI │ ├── ObjectItem.cs │ ├── ObjectItem.cs.meta │ ├── ObjectListArea.cs │ └── ObjectListArea.cs.meta ├── Unity.RemoteFileExplorer.Editor.asmdef ├── Unity.RemoteFileExplorer.Editor.asmdef.meta ├── Utilities.meta └── Utilities │ ├── BeforeUploadAttribute.cs │ ├── BeforeUploadAttribute.cs.meta │ ├── CustomMenuAttribute.cs │ ├── CustomMenuAttribute.cs.meta │ ├── EditorReflection.cs │ ├── EditorReflection.cs.meta │ ├── NetworkUtility.cs │ ├── NetworkUtility.cs.meta │ ├── TextureUtility.cs │ └── TextureUtility.cs.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Resources.meta ├── Resources ├── Icons.meta ├── Icons │ ├── cs active.png │ ├── cs active.png.meta │ ├── cs.png │ ├── cs.png.meta │ ├── d_cs active.png │ ├── d_cs active.png.meta │ ├── d_cs.png │ ├── d_cs.png.meta │ ├── d_default active.png │ ├── d_default active.png.meta │ ├── d_default.png │ ├── d_default.png.meta │ ├── d_folder active.png │ ├── d_folder active.png.meta │ ├── d_folder.png │ ├── d_folder.png.meta │ ├── d_project active.png │ ├── d_project active.png.meta │ ├── d_project.png │ ├── d_project.png.meta │ ├── d_shader active.png │ ├── d_shader active.png.meta │ ├── d_shader.png │ ├── d_shader.png.meta │ ├── default active.png │ ├── default active.png.meta │ ├── default.png │ ├── default.png.meta │ ├── folder active.png │ ├── folder active.png.meta │ ├── folder.png │ ├── folder.png.meta │ ├── project active.png │ ├── project active.png.meta │ ├── project.png │ ├── project.png.meta │ ├── shader active.png │ ├── shader active.png.meta │ ├── shader.png │ └── shader.png.meta ├── StyleSheets.meta ├── StyleSheets │ ├── RemoteFileExplorer_style.uss │ ├── RemoteFileExplorer_style.uss.meta │ ├── RemoteFileExplorer_style_dark.uss │ ├── RemoteFileExplorer_style_dark.uss.meta │ ├── RemoteFileExplorer_style_light.uss │ └── RemoteFileExplorer_style_light.uss.meta ├── UXML.meta └── UXML │ ├── ObjectItem.uxml │ ├── ObjectItem.uxml.meta │ ├── RemoteFileExplorer.uxml │ └── RemoteFileExplorer.uxml.meta ├── Runtime.meta ├── Runtime ├── Base.meta ├── Base │ ├── DataType.cs │ ├── DataType.cs.meta │ ├── ISerialize.cs │ ├── ISerialize.cs.meta │ ├── Package.cs │ ├── Package.cs.meta │ ├── Packer.cs │ ├── Packer.cs.meta │ ├── Session.cs │ ├── Session.cs.meta │ ├── Unpacker.cs │ └── Unpacker.cs.meta ├── Commands.meta ├── Commands │ ├── Command.cs │ ├── Command.cs.meta │ ├── CommandType.cs │ ├── CommandType.cs.meta │ ├── CreateDirectory.cs │ ├── CreateDirectory.cs.meta │ ├── Delete.cs │ ├── Delete.cs.meta │ ├── NewFolder.cs │ ├── NewFolder.cs.meta │ ├── Pull.cs │ ├── Pull.cs.meta │ ├── QueryDeviceInfo.cs │ ├── QueryDeviceInfo.cs.meta │ ├── QueryPathInfo.cs │ ├── QueryPathInfo.cs.meta │ ├── QueryPathKeyInfo.cs │ ├── QueryPathKeyInfo.cs.meta │ ├── Rename.cs │ ├── Rename.cs.meta │ ├── TransferFile.cs │ └── TransferFile.cs.meta ├── Common.meta ├── Common │ ├── Coroutines.cs │ ├── Coroutines.cs.meta │ ├── FileUtil.cs │ ├── FileUtil.cs.meta │ ├── Log.cs │ ├── Log.cs.meta │ ├── Octets.cs │ ├── Octets.cs.meta │ ├── OctetsCache.cs │ ├── OctetsCache.cs.meta │ ├── Pool.cs │ ├── Pool.cs.meta │ ├── Singleton.cs │ └── Singleton.cs.meta ├── FileExplorerClient.cs ├── FileExplorerClient.cs.meta ├── FileExplorerWindow.cs ├── FileExplorerWindow.cs.meta ├── Logic.meta ├── Logic │ ├── Client.cs │ ├── Client.cs.meta │ ├── Robot.cs │ ├── Robot.cs.meta │ ├── Serializer.cs │ ├── Serializer.cs.meta │ ├── Server.cs │ ├── Server.cs.meta │ ├── Socket.cs │ └── Socket.cs.meta ├── Unity.RemoteFileExplorer.asmdef └── Unity.RemoteFileExplorer.asmdef.meta ├── package.json └── package.json.meta /Documentation~/Images/add_from_git_url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/add_from_git_url.png -------------------------------------------------------------------------------- /Documentation~/Images/drag_from_explorer_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/drag_from_explorer_upload.png -------------------------------------------------------------------------------- /Documentation~/Images/drag_from_project_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/drag_from_project_upload.png -------------------------------------------------------------------------------- /Documentation~/Images/file_explorer_client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/file_explorer_client.png -------------------------------------------------------------------------------- /Documentation~/Images/file_explorer_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/file_explorer_window.png -------------------------------------------------------------------------------- /Documentation~/Images/go_to_path_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/go_to_path_key.png -------------------------------------------------------------------------------- /Documentation~/Images/input_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/input_path.png -------------------------------------------------------------------------------- /Documentation~/Images/main_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/main_ui.png -------------------------------------------------------------------------------- /Documentation~/Images/package_manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/package_manager.png -------------------------------------------------------------------------------- /Documentation~/Images/right_click_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/right_click_delete.png -------------------------------------------------------------------------------- /Documentation~/Images/right_click_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/right_click_download.png -------------------------------------------------------------------------------- /Documentation~/Images/right_click_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/right_click_refresh.png -------------------------------------------------------------------------------- /Documentation~/Images/right_click_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/right_click_upload.png -------------------------------------------------------------------------------- /Documentation~/Images/status_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/status_panel.png -------------------------------------------------------------------------------- /Documentation~/Images/status_panel_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/status_panel_small.png -------------------------------------------------------------------------------- /Documentation~/Images/status_panel_small2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwiniwin/unity-remote-file-explorer/8aabfed633f924b4b18e8278ce59484d19909391/Documentation~/Images/status_panel_small2.png -------------------------------------------------------------------------------- /Documentation~/RemoteFileExplorer.md: -------------------------------------------------------------------------------- 1 | ## 安装 2 | 本工具是采用Unity的[包](https://docs.unity3d.com/cn/2019.4/Manual/PackagesList.html)形式,可以通过*Unity Package Manager*直接安装 3 | 4 | ![](Images/package_manager.png) 5 | 6 | 这里介绍两种常用方式 7 | * 打开*Package Manager*窗口后,单击状态栏左侧的`+`按钮,选择`Add package from git URL`,然后在文本框中输入本工具的git地址`https://github.com/iwiniwin/unity-remote-file-explorer.git`,单击`Add`按钮后完成安装 8 | 9 | ![](Images/add_from_git_url.png) 10 | 11 | * 或直接克隆本工具到项目的`Pacages`目录下 12 | 13 | 更多将本工具作为包的安装方式可查看[Unity官方文档](https://docs.unity3d.com/cn/2019.4/Manual/upm-ui-actions.html) 14 | 15 | ## 使用 16 | 安装本工具后,可通过`Window > Analysis > Remote File Explorer`打开本工具窗口,将自动启动服务器 17 | 18 | 给项目的任意游戏对象添加`FileExplorerClient`组件 19 | 20 | ![](Images/file_explorer_client.png) 21 | 22 | 如果是固定连接到某台机器上,可直接通过Inspector面板在`Host`域输入这台机器的IP地址,然后勾选`Connect Automatically`,则会在应用启动时自动连接 23 | 24 | 如果希望应用启动后能主动选择连接到哪台机器,则可在Debug模式下封装一套简单的UI,使开发人员能够输入想要连接到的IP地址。例如在自己的菜单中添加一个条目或按钮,点击后弹出输入窗口。在成功获取到的IP地址后,将其赋值给`FileExplorerClient`组件的`Host`属性,然后调用`FileExplorerClient`组件的`StartConnect`方法开启连接 25 | 26 | > 注意在启动连接前,请通过`Window > Analysis > Remote File Explorer`打开本工具窗口,否则将无法连接 27 | 28 | 通过本工具的`Status`面板可以查看到当前机器的IP地址 29 | 30 | ![](Images/status_panel_small.png) 31 | 32 | 当连接成功后,本工具标题栏的Icon会变成绿色,以表示连接状态是已连接 33 | 34 | ![](Images/status_panel_small2.png) 35 | 36 | ## 功能介绍 37 | * 通过状态栏的`GOTO`可直接跳转到Unity预定义的一些路径 38 | 39 | ![](Images/go_to_path_key.png) 40 | 41 | * 通过单击路径栏可打开输入框,以直接输入路径跳转或复制当前路径 42 | 43 | ![](Images/input_path.png) 44 | 45 | * 右键所选中的文件夹或文件支持下载 46 | 47 | ![](Images/right_click_download.png) 48 | 49 | * 右键所选中的文件夹或文件支持删除 50 | 51 | ![](Images/right_click_delete.png) 52 | 53 | * 右键空白区域支持上传文件夹或文件 54 | 55 | ![](Images/right_click_upload.png) 56 | 57 | * 右键空白区域支持刷新当前路径的内容 58 | 59 | ![](Images/right_click_refresh.png) 60 | 61 | * 支持直接从`Unity Project`窗口拖拽文件夹或文件到本工具上传 62 | 63 | ![](Images/drag_from_project_upload.png) 64 | 65 | * 支持直接从系统文件浏览器拖拽文件夹或文件到本工具上传 66 | 67 | ![](Images/drag_from_explorer_upload.png) 68 | 69 | * 通过本工具`status`面板可查看连接状态以及已连接设备的信息,可用于辨别连接的是哪台设备 70 | 71 | ![](Images/status_panel.png) 72 | 73 | -------------------------------------------------------------------------------- /Documentation~/TODO.md: -------------------------------------------------------------------------------- 1 | 2 | ### TODO 3 | * 处理.jar只读问题 4 | * 上传下载时Icon变化以显示状态 5 | * 当前任务显示 6 | * 命令支持超时 7 | 8 | ### Test 9 | -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91e1bb42b4960f040a3acdb688100f4b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Logic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f02b38a596575f4b8a49f699c0f5c22 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Logic/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace RemoteFileExplorer.Editor 2 | { 3 | public class Constants 4 | { 5 | public const string WindowTitle = "Remote File Explorer"; 6 | 7 | public const string SelectFileTitle = "Select File"; 8 | public const string SelectFolderTitle = "Select Folder"; 9 | 10 | public const string NotConnectedTip = "The network is not connected, please try again after connecting"; 11 | public const string PathNotExistTip = "Could not find \"{0}\", please check spelling and try again"; 12 | public const string PathKeyNotExistTip = "{0} : \"{1}\" does not exist"; 13 | public const string NetworkErrorTip = "Network Error : {0}"; 14 | public const string UnknownError = "unknown error"; 15 | 16 | public const string DownloadFailedTip = "Download \"{0}\" failed. "; 17 | public const string DownloadSuccessTip = "Download \"{0}\" successfully"; 18 | 19 | public const string UploadConfirmTip = "Are you sure to upload the following directories or files:{0}{1}\nTo:{0}{2}?"; 20 | public const string UploadFailedTip = "Upload \"{0}\" failed. "; 21 | public const string UploadSuccessTip = "Upload \"{0}\" successfully"; 22 | public const string BeforeUploadCallTip = "before upload call : \"{0}\""; 23 | public const string NoDestPathTip = "Please go to the destination first"; 24 | 25 | public const string DeleteConfirmTip = "Are you sure you want to delete \"{0}\"?"; 26 | public const string DeleteFailedTip = "Delete \"{0}\" failed. "; 27 | public const string DeleteSuccessTip = "Delete \"{0}\" successfully"; 28 | 29 | public const string NewFolderFailedTip = "NewFolder \"{0}\" failed. "; 30 | 31 | public const string RenameFailedTip = "Rename \"{0}\" failed. "; 32 | public const string RenameSuccessTip = "Rename \"{0}\" successfully"; 33 | 34 | public const string UnknownText = "Unknown"; 35 | public const string OkText = "Ok"; 36 | public const string RevealInExplorerText = "Reveal In Finder"; 37 | public const string CancelText = "Cancel"; 38 | } 39 | } -------------------------------------------------------------------------------- /Editor/Logic/Constants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5868bd8c1a7165e479df9a1929909b7c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Logic/Manipulator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba74fa39fc536ad4c87bb728969aad80 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Logic/TaskManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System; 4 | 5 | namespace RemoteFileExplorer.Editor 6 | { 7 | public enum TaskType 8 | { 9 | GoTo, 10 | Download, 11 | Upload 12 | } 13 | 14 | public class Task 15 | { 16 | public TaskType Type; 17 | public Coroutine Coroutine; 18 | public DateTime StartTime; 19 | } 20 | 21 | public class TaskManager 22 | { 23 | private static List m_TaskList = new List(); 24 | 25 | public static void StartTask(TaskType type, IEnumerator routine) 26 | { 27 | if(type == TaskType.GoTo) // 同一时刻只能有一个GoTo task 28 | { 29 | // StopTasks(type); 30 | var list = GetTasks(type); 31 | } 32 | Task task = new Task() 33 | { 34 | Type = type, 35 | Coroutine = Coroutines.Start(routine), 36 | StartTime = DateTime.Now, 37 | }; 38 | m_TaskList.Add(task); 39 | } 40 | 41 | public static List GetTasks(TaskType type) 42 | { 43 | UpdateTasks(); 44 | List list = new List(); 45 | foreach(var task in m_TaskList) 46 | { 47 | if(task.Type == type) 48 | { 49 | list.Add(task); 50 | } 51 | } 52 | return list; 53 | } 54 | 55 | public static List GetTasks() 56 | { 57 | UpdateTasks(); 58 | return m_TaskList; 59 | } 60 | 61 | public static void StopTasks(TaskType type) 62 | { 63 | UpdateTasks(); 64 | for(int i = m_TaskList.Count - 1; i >= 0; i --) 65 | { 66 | if(m_TaskList[i].Type == type) 67 | { 68 | Coroutines.Stop(m_TaskList[i].Coroutine); 69 | m_TaskList.RemoveAt(i); 70 | } 71 | } 72 | } 73 | 74 | public static void UpdateTasks() 75 | { 76 | for(int i = m_TaskList.Count - 1; i >= 0; i --) 77 | { 78 | // if(m_TaskList[i].Coroutine.Finished) 79 | // { 80 | // m_TaskList.RemoveAt(i); 81 | // } 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Editor/Logic/TaskManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e9ae3342a450c742b04defba013898e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/RemoteFileExplorer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18754918d7fef3445b9084e5a84ec2e6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1235ffce27a239441bda92217e397d0e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/UI/ObjectItem.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | using UnityEditor; 3 | using UnityEngine; 4 | using System.IO; 5 | using System; 6 | using UnityEditor.Experimental; 7 | 8 | namespace RemoteFileExplorer.Editor.UI 9 | { 10 | public class ObjectItem : VisualElement 11 | { 12 | public Action clickItemCallback; 13 | public Action doubleClickItemCallback; 14 | public Action rightClickItemCallback; 15 | public Action completeInputCallback; 16 | const string k_UxmlFilesPath = "Packages/com.iwin.remotefileexplorer/Resources/UXML/ObjectItem.uxml"; 17 | 18 | public VisualElement objectView { get; } 19 | public Image objectIcon { get; } 20 | public Label objectLabel { get; } 21 | public TextField objectTextField { get; } 22 | private ObjectData m_Data; 23 | private Vector2 m_Size; 24 | public Vector2 Size 25 | { 26 | set 27 | { 28 | m_Size = value; 29 | this.style.width = value.x; 30 | this.style.height = value.y; 31 | } 32 | } 33 | 34 | public ObjectData Data 35 | { 36 | get 37 | { 38 | return m_Data; 39 | } 40 | } 41 | 42 | public ObjectItem(Vector2 size) 43 | { 44 | this.Size = size; 45 | var tree = AssetDatabase.LoadAssetAtPath(k_UxmlFilesPath); 46 | tree.CloneTree(this); 47 | 48 | objectView = this.Q("objectView"); 49 | objectIcon = this.Q("objectIcon"); 50 | objectTextField = this.Q("objectTextField"); 51 | objectLabel = this.Q