2016. 5. 20. 22:27
https://blog.naver.com/nagne2011/220715140804
- 25 - Unity - 파일/폴더 생성, 삭제, 확인
using System.IO 을 사용한다. 생성 System.IO.File.Create ( string FilePath ); 삭제 System....
blog.naver.com
using System.IO
을 사용한다.
생성
System.IO.File.Create ( string FilePath );
삭제
System.IO.File.Delete( string FilePath );
체크
System.IO.File.Exists( string FilePath );
**폴더 일경우는 FileInfo 대신에 DirectoryInfo 사용한다.
예시
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
using System.IO;
public class saveData : MonoBehaviour {
public string strSlot_0;
void Awake()
{
strSlot_0 = Application.dataPath + "/saveData/slot_0/saveDataList.xml";
}
public int CheckSaveSlot_0()
{
if (File.Exists(strSlot_0) == false)
{
return 0;
} else
return 1;
}
}
|
cs |
728x90
'유니티' 카테고리의 다른 글
UI 손풀기 : 포켓몬스터 느낌의 인벤토리 (0) | 2022.02.14 |
---|---|
유니티 문자열 자르기 (0) | 2022.02.14 |
유니티 XML 저장/불러오기 (0) | 2022.02.14 |
유니티 터치좌표로 상하좌우 구분하기 (0) | 2022.02.14 |
유니티 버튼만들기 (0) | 2022.02.13 |