chore: initialize standalone UPM package
Publish UPM package / publish (push) Failing after 1s

This commit is contained in:
2026-08-26 02:50:43 +08:00
commit 1180be88a6
72 changed files with 3331 additions and 0 deletions
@@ -0,0 +1,41 @@
using UnityEngine;
namespace ShrinkTutorial
{
public sealed class PlayerPrefsShrinkTutorialStorage : IShrinkTutorialStorage
{
private readonly string _storageKey;
public PlayerPrefsShrinkTutorialStorage(string storageKey)
{
_storageKey = string.IsNullOrWhiteSpace(storageKey)
? "ShrinkTutorial.Progress"
: storageKey;
}
public ShrinkTutorialProgress Load()
{
if (!PlayerPrefs.HasKey(_storageKey))
return new ShrinkTutorialProgress();
var json = PlayerPrefs.GetString(_storageKey, string.Empty);
if (string.IsNullOrWhiteSpace(json))
return new ShrinkTutorialProgress();
return JsonUtility.FromJson<ShrinkTutorialProgress>(json) ?? new ShrinkTutorialProgress();
}
public void Save(ShrinkTutorialProgress progress)
{
var json = JsonUtility.ToJson(progress ?? new ShrinkTutorialProgress());
PlayerPrefs.SetString(_storageKey, json);
PlayerPrefs.Save();
}
public void Reset()
{
PlayerPrefs.DeleteKey(_storageKey);
PlayerPrefs.Save();
}
}
}