Ejemplo n.º 1
0
        public void Setup(EditionConfig _editionConfig)
        {
            this.edition = _editionConfig.Edition;

            iconImage.sprite = _editionConfig.EditionIcon;
            nameText.text    = _editionConfig.EditionTitle;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Charge this with PlayerProfileData.
        /// </summary>
        public PlayerProfile FromData(PlayerProfileData _data)
        {
            Uuid = _data.Uuid;

            AvatarId                       = _data.AvatarId;
            Tint                           = _data.Tint;
            Age                            = _data.Age;
            AppVersion                     = _data.AppVersion;
            Edition                        = _data.Edition;
            Gender                         = _data.Gender;
            SkinColor                      = string.IsNullOrEmpty(_data.SkinColor) ? Color.white : _data.SkinColor.HexToColor();
            HairColor                      = string.IsNullOrEmpty(_data.HairColor) ? Color.white : _data.HairColor.HexToColor();
            BgColor                        = string.IsNullOrEmpty(_data.BgColor) ? Color.white : _data.BgColor.HexToColor();
            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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public PlayerIconData(string _Uuid, int _AvatarId, PlayerTint _Tint, PlayerGender _Gender, Color _SkinColor, Color _HairColor, Color _BgColor, bool _IsDemoUser,
                       bool _HasFinishedTheGame, bool _HasFinishedTheGameWithAllStars, bool _HasMaxStarsInCurrentPlaySessions, JourneyPosition _MaxJourneyPosition, AppEditions _Edition, string _AppVersion)
 {
     Uuid                             = _Uuid;
     AvatarId                         = _AvatarId;
     SkinColor                        = _SkinColor;
     HairColor                        = _HairColor;
     BgColor                          = _BgColor;
     Gender                           = _Gender;
     Tint                             = _Tint;
     IsDemoUser                       = _IsDemoUser;
     HasFinishedTheGame               = _HasFinishedTheGame;
     HasFinishedTheGameWithAllStars   = _HasFinishedTheGameWithAllStars;
     HasMaxStarsInCurrentPlaySessions = _HasMaxStarsInCurrentPlaySessions;
     MaxJourneyPosition               = _MaxJourneyPosition;
     Edition                          = _Edition;
     AppVersion                       = _AppVersion;
     Debug.Log("CREATE PLAYER ICON DATA > " + SkinColor + " > " + HairColor);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Creates the player profile.
        /// </summary>
        public string CreatePlayerProfile(bool isNewAvatar, int avatarID, PlayerGender gender, PlayerTint tint, Color skinColor, Color hairColor, Color bgColor, int age, AppEditions edition, string appVersion, bool isDemoUser = false)
        {
            PlayerProfile returnProfile = new PlayerProfile();

            // Data
            returnProfile.Uuid = System.Guid.NewGuid().ToString();
            if (isNewAvatar)
            {
                avatarID += NEW_AVATAR_ID_START;
            }
            returnProfile.AvatarId          = avatarID;
            returnProfile.Gender            = gender;
            returnProfile.Tint              = tint;
            returnProfile.SkinColor         = skinColor;
            returnProfile.HairColor         = hairColor;
            returnProfile.BgColor           = bgColor;
            returnProfile.IsDemoUser        = isDemoUser;
            returnProfile.Age               = age;
            returnProfile.AppVersion        = appVersion;
            returnProfile.Edition           = edition;
            returnProfile.ProfileCompletion =
                isDemoUser ? ProfileCompletionState.GameCompletedAndFinalShown : ProfileCompletionState.New;
            returnProfile.GiftInitialBones();

            // DB Creation
            AppManager.I.DB.CreateDatabaseForPlayer(returnProfile.ToData());
            // Added to list
            AppManager.I.AppSettings.SavedPlayers.Add(returnProfile.GetPlayerIconData());
            // Set player profile as current player
            AppManager.I.PlayerProfileManager.CurrentPlayer = returnProfile;
            // Unlock the first Antura rewards
            AppManager.I.RewardSystemManager.UnlockFirstSetOfRewards();

            // Call Event Profile creation
            if (OnNewProfileCreated != null)
            {
                OnNewProfileCreated();
            }

            AppManager.I.Services.Analytics.TrackCompletedRegistration(returnProfile);

            return(returnProfile.Uuid);
        }
Ejemplo n.º 6
0
 public void SetSpecificEdition(AppEditions edition)
 {
     Settings.SpecificEdition = edition;
     SaveSettings();
 }