あなたの世界を作りなさい
データストレージ
PlayerPrefs - デバイスにデータを保存
1min
接続しているデバイスにプレイヤーを保存する機能を提供します。 クライアント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