public void OnViewConstruct(Evt evt) { score = (HUDScoreView)evt.Source; int level = PlayerStateStorage.Get().Level; score.MaxValue = LevelSettingsStorage.Get(level).CompletionScore; }
private void AddPlayerLevelCompletionPercentage() { int level = playerStateStorage.Get().Level; int levelCompletionScore = levelSettingsStorage.Get(level).CompletionScore; int levelCompletionPercentage = player.Score * 10 / levelCompletionScore; AnalyticsUtils.AddCategorizedEventParam( "Player.LevelCompletionPercentage", levelCompletionPercentage); }
public void OnScoreChange(Evt evt) { LevelSettings levelSettings = levelSettingsStorage.Get(playerStateStorage.Get().Level); if (player.Score < levelSettings.CompletionScore) { return; } playStopwatch.Stop(); playerManager.CompleteLevel(player); }
/** * @return Given resurrections count */ public int Give(PlayerState playerState) { DebugUtils.Assert(playerState.AvailableRewardsCount > 0); int addResurrectionsCount = levelSettingsStorage.Get(playerState.Level).ResurrectionReward; playerState.AvailableResurrectionsCount += addResurrectionsCount; if (--playerState.AvailableRewardsCount == 0) { Lock(playerState); } return(addResurrectionsCount); }