파일2 [Unity] Windows 파일 드래그 앤 드롭 구현하기(Drag and Drop) Unity에서 사용자가 파일 경로를 직접 입력해서, 파일 입출력을 해야하는 경우도 종종 있다. 만약, 접근하고자 하는 파일의 개수가 적다면 모르겠지만, 많다면 불편함을 겪게 될 것이다. 이번 글에서는 간단히 파일을 드래그 앤 드롭하는 것만으로도 파일 경로를 가져올 수 있는 방법에 대해 알아보겠다. Script 이번 기능은 직접 구현한 것은 아니고, Bunny83님의 UnityWindowsFileDrag-Drop 레포지토리를 참고했다. https://github.com/Bunny83/UnityWindowsFileDrag-Drop GitHub - Bunny83/UnityWindowsFileDrag-Drop: Adds file drag and drop support for Unity standalong bui.. 2023. 9. 10. [Unity] 읽기 전용 폴더와 하위 파일들을 모두 삭제하기 하위에 있는 읽기 전용 폴더나 파일을 전부 삭제할 수 있는 함수이다. private void DeleteDirectory(string _folderPath) { File.SetAttributes(_folderPath, FileAttributes.Normal); //폴더 읽기 전용 해제 foreach (string _folder in Directory.GetDirectories(_folderPath)) //폴더 탐색 { DeleteDirectory(_folder); //재귀 호출 } foreach (string _file in Directory.GetFiles(_folderPath)) //파일 탐색 { File.SetAttributes(_file, FileAttributes.Normal); //파일 읽기 .. 2020. 5. 3. 이전 1 다음