Table of Contents

Class SaveSystem

Namespace
Framework.Systems.Save
Assembly
Assembly-CSharp.dll

ISaveSystem 구현체. MemoryPack 바이너리 기반 로컬 저장/로드.

public sealed class SaveSystem : ISaveSystem
Inheritance
object
SaveSystem
Implements

Remarks

[직렬화] IMemoryPackSerializer(MemoryPack). [버전] SaveFile<T> 래퍼로 버전 정보를 포함해 저장. 로드 시 SaveVersion.IsCompatible로 호환성 확인. [재시도] SaveAsync IO 예외 시 1회 재시도. [Key] null / 빈 문자열 / 공백 → Result.Fail, 예외 없음. 저장 경로: Application.persistentDataPath/{key}.bin

Constructors

SaveSystem(IMemoryPackSerializer)

public SaveSystem(IMemoryPackSerializer serializer)

Parameters

serializer IMemoryPackSerializer

Methods

Delete(string)

해당 키의 저장 파일 삭제. 파일 미존재 / IO 오류 시 Result.Fail 반환. 예외 발생 금지.

public Result Delete(string key)

Parameters

key string

Returns

Result

Exists(string)

해당 키의 저장 파일 존재 여부.

public bool Exists(string key)

Parameters

key string

Returns

bool

GetKeys()

persistentDataPath에 존재하는 전체 저장 키 목록. UI 슬롯 표시 / 자동 저장 목록 등에 활용.

public IReadOnlyList<string> GetKeys()

Returns

IReadOnlyList<string>

LoadAsync<T>(string, CancellationToken)

데이터 비동기 로드. 파일이 없거나 로드 실패 시 Result.Fail 반환.

public UniTask<Result<T>> LoadAsync<T>(string key, CancellationToken ct = default)

Parameters

key string

로드 키.

ct CancellationToken

취소 신호.

Returns

UniTask<Result<T>>

Type Parameters

T

[MemoryPackable] 선언된 타입.

SaveAsync<T>(string, T, CancellationToken)

데이터 비동기 저장. IO 예외 시 1회 재시도.

public UniTask<Result> SaveAsync<T>(string key, T data, CancellationToken ct = default)

Parameters

key string

저장 키 (.bin 파일명으로 사용).

data T

저장할 데이터.

ct CancellationToken

취소 신호.

Returns

UniTask<Result>

Type Parameters

T

[MemoryPackable] 선언된 타입.