CREATE YOUR WORLD
데이터 저장소 (Data Storage)
PlayerPrefs - 기기에 데이터 저장하기
1 분
연결된 장치에 플레이어를 저장할 수 있는 기능을 제공합니다 클라이언트 zepeto 스크립트에서 호출할 수 있으며, 앱을 삭제하거나 장치를 변경하면 데이터가 보존되지 않습니다 unity의 playerprefs와 동일한 방식으로 사용을 지원하며, 저장 용량은 10kb로 제한됩니다 ▼ save & load 기능을 사용하여 플레이 수를 확인하는 예제 코드 import { zepetoscriptbehaviour } from 'zepeto script'; import { playerprefs } from 'unityengine'; export default class clientsaveload extends zepetoscriptbehaviour { private playcntkey string = 'keyname'; start() { if (playerprefs haskey(this playcntkey)) { playerprefs setint(this playcntkey, playerprefs getint(this playcntkey) + 1); console log(`playcnt ${ playerprefs getint(this playcntkey) }`); } else { playerprefs setint(this playcntkey, 1); console log('playcnt 1'); } } } 📘 unity playerprefs 정보 보기 https //docs unity3d com/scriptreference/playerprefs html https //docs unity3d com/scriptreference/playerprefs html