/// <summary> /// Charge this with PlayerProfileData. /// </summary> public PlayerProfile FromData(PlayerProfileData _data) { Uuid = _data.Uuid; AvatarId = _data.AvatarId; Age = _data.Age; Gender = _data.Gender; Tint = _data.Tint; IsDemoUser = _data.IsDemoUser; HasFinishedTheGame = _data.JourneyCompleted; HasFinishedTheGameWithAllStars = _data.HasFinishedTheGameWithAllStars(); ProfileCompletion = _data.ProfileCompletion; TotalNumberOfBones = _data.TotalBones; HasMaxStarsInCurrentPlaySessions = _data.GetAdditionalData().HasMaxStarsInCurrentPlaySessions; ConsecutivePlayDays = _data.GetAdditionalData().ConsecutivePlayDays; CurrentShopState = AnturaSpace.ShopState.CreateFromJson(_data.GetAdditionalData().CurrentShopStateJSON); FirstContactState = JsonUtility.FromJson <FirstContactState>(_data.FirstContactStateJSON); SetCurrentJourneyPosition(_data.GetCurrentJourneyPosition(), false); SetMaxJourneyPosition(_data.GetMaxJourneyPosition(), false); // Antura customization save only customization data jsonAnturaCustomizationData = _data.CurrentAnturaCustomization; return(this); }
public PlayerProfileData( string _Uuid, int _AvatarId, PlayerGender _Gender, PlayerTint _Tint, Color _SkinColor, Color _HairColor, Color _BgColor, int _Age, bool _IsDemoUser, bool _HasFinishedTheGame, bool _HasFinishedTheGameWithAllStars, bool _HasMaxStarsInCurrentPlaySessions, int totalBones, ProfileCompletionState profileCompletion, string currentAnturaCustomization, int comboPlayDays, AnturaSpace.ShopState currentShopState, FirstContactState currentFirstContactState, AppEditions edition, string appVersion ) { Id = UNIQUE_ID; // Only one record AppVersion = appVersion; Edition = edition; Uuid = _Uuid; AvatarId = _AvatarId; Gender = _Gender; Tint = _Tint; SkinColor = _SkinColor.ToHex(); HairColor = _HairColor.ToHex(); BgColor = _BgColor.ToHex(); IsDemoUser = _IsDemoUser; JourneyCompleted = _HasFinishedTheGame; TotalScore = (_HasFinishedTheGameWithAllStars ? 1f : 0f); Age = _Age; ProfileCompletion = profileCompletion; TotalBones = totalBones; SetMaxJourneyPosition(JourneyPosition.InitialJourneyPosition); SetCurrentJourneyPosition(JourneyPosition.InitialJourneyPosition); Timestamp = GenericHelper.GetTimestampForNow(); CurrentAnturaCustomization = currentAnturaCustomization; AdditionalData = JsonUtility.ToJson(new PlayerProfileAdditionalData(_HasMaxStarsInCurrentPlaySessions, comboPlayDays, currentShopState.ToJson())); FirstContactStateJSON = JsonUtility.ToJson(currentFirstContactState); }