Serializable
インスペクターから見えるようにする。
using UnityEngine; using System; using System.Collections; using System.Collections.Generic; [Serializable] public class ItemCollection{ public int _Id; public Sprite _ItemSprite; public int _CurrentCollected{ get{ if (ES2.Exists ("_CurrentCollected" + _Id)) { return ES2.Load<int> ("_CurrentCollected" + _Id); }else { return 0; } } set{ ES2.Save (value, "_CurrentCollected" + _Id); } } public int _ToCollected = 3; public bool _Unlocked{ get{ //呼び出すときにセーブする必要がない。 //呼び出すときに自動的に以下の動作が行われる。 if (ES2.Exists ("Unlock" + _Id)) { return ES2.Load<bool> ("Unlock" + _Id); } else { return false; } } set{ ES2.Save (value, "Unlock" + _Id); } } public int _CurrentGallery; }