示例#1
0
        public static Profile initProfile()
        {
            SavedProfile tmpProfile = SaveGameManager.loadDataByUser <SavedProfile>(GameConstants.profileKey);

            if (tmpProfile == null || String.IsNullOrEmpty(tmpProfile.Profile))
            {
                _profile = new Profile();
                _profile.reset();
            }
            else
            {
                JSONNode js = JSON.Parse(tmpProfile.Profile);
                _profile = new Profile(js);
            }
            saveProfile();
            return(_profile);
        }