Ejemplo n.º 1
0
        IEnumerator Save(GameSaveData data)
        {
            PlaySaveData = data;
            if (m_recordObject == null)
            {
                m_recordObject          = new NCMBObject(NCMB_CLASSNAME);
                m_recordObject.ObjectId = ObjectID;
            }

            m_recordObject = ConvertPlayerData2NCMB(data, m_recordObject);

            NCMBException errorResult = null;

            yield return(m_recordObject.YieldableSaveAsync(error => errorResult = error));

            if (errorResult != null)
            {
                //NCMBのコンソールから直接削除した場合に、該当のobjectIdが無いので発生する(らしい)
                m_recordObject.ObjectId = null;
                yield return(m_recordObject.YieldableSaveAsync(error => errorResult = error)); //新規として送信
            }

            //ObjectIDを保存して次に備える
            ObjectID = m_recordObject.ObjectId;
        }
Ejemplo n.º 2
0
        protected override bool CheckAchieved(IPlaySaveData playSaveData, out string[] keys)
        {
            string rank = Services.UserRankCalculator.GetRank();
            var    info = m_achievements.FirstOrDefault(x => x.key == rank);

            if (info == null)
            {
                keys = null;
                return(false);
            }
            else
            {
                keys = info.enables.Select(x => string.Format(Format, x)).ToArray();
                return(true);
            }
        }
Ejemplo n.º 3
0
        public IEnumerator Load()
        {
            //objectIDで検索
            var hiScoreCheck = new YieldableNcmbQuery <NCMBObject>(NCMB_CLASSNAME);

            hiScoreCheck.WhereEqualTo(OBJECTID_KEY, ObjectID);
            yield return(hiScoreCheck.FindAsync());

            if (hiScoreCheck.Count == 0)
            {
                Debug.LogError($"データが見つかりません objectID={ObjectID}");
                yield break;
            }
            var ncmbObject = hiScoreCheck.Result[0];

            PlaySaveData = ConvertNCMB2PlayerData(ncmbObject);
        }
Ejemplo n.º 4
0
 protected override bool CheckAchieved(IPlaySaveData playSaveData, out string[] keys)
 {
     keys = m_achievements.Where(x => x <= playSaveData.PlayCount).Select(x => string.Format(Format, x)).ToArray();
     return(keys.Length != 0);
 }
 protected override bool CheckAchieved(IPlaySaveData playSaveData, out string[] keys)
 {
     keys = m_achievements.Where(x => x * Constants.TotalScoreRate <= playSaveData.TotalScore).Select(x => string.Format(Format, x)).ToArray();
     return(keys.Length != 0);
 }