private PointsSummary GetPointsSummaryData(PointsSummary model) { DebugUtils.StartLogEvent("OwnerController.GetPointsSummaryData"); BlueGreenContext bgContext = new BlueGreenContext(); string ownerId = bgContext.OwnerId; model.AnnualPoints = "0"; model.SavedPoints = "0"; model.RestrictedPoints = "0"; model.AvailablePoints = "0"; try { ProfileService service = new ProfileService(); RestOwnerPointsResponse result = service.GetOwnerPoints(ownerId, null); if (result != null && result.Account != null && result.Account.Memberships != null && result.Account.Memberships.VacationClubMembership != null && result.Account.Memberships.VacationClubMembership.Points != null) { model.AnnualPoints = FormatUtils.FormatPoints(result.Account.Memberships.VacationClubMembership.Points.TotalAnnualPoints); model.SavedPoints = FormatUtils.FormatPoints(result.Account.Memberships.VacationClubMembership.Points.TotalSavedPoints); model.RestrictedPoints = FormatUtils.FormatPoints(result.Account.Memberships.VacationClubMembership.Points.TotalRestrictedPoints); model.AvailablePoints = FormatUtils.FormatPoints(result.Account.Memberships.VacationClubMembership.Points.TotalPoints); } } catch (Exception ex) { Sitecore.Diagnostics.Log.Error("Unexpected exception retreiving points for " + ownerId, ex, bgContext); } DebugUtils.EndLogEvent("OwnerController.GetPointsSummaryData"); return(model); }
private IEnumerator OnTriggerEnter2D(Collider2D collision) { Player winner = collision.gameObject.GetComponent <Player>(); if (!this.triggered && winner != null) { this.triggered = false; this.gameObject.GetComponent <Collider2D> ().enabled = false; Finish finish = Finish.Instance; HUD.Hide(); finish.ShowFinish(PlayerManager.Instance.GetPlayerName(winner.playerNumber) + " won!"); yield return(new WaitForSeconds(2f)); finish.HideFinish(); // int points = 75; // if (PointSystem.Instance.CurrentLeader() == winner.playerNumber // && PointSystem.Instance.GetCurrentPoints(winner.playerNumber) == 150) // points = 50; PointsSummary pointsSummary = PointsSummary.Instance; int newPoints = PointSystem.Instance.AddPoints(winner.playerNumber, 75); pointsSummary.Show(); pointsSummary.SetCurrentPoints(winner.playerNumber, newPoints, 2f); yield return(new WaitForSeconds(2f)); pointsSummary.Hide(); yield return(new WaitForSeconds(2f)); if (PointSystem.Instance.GetCurrentPoints(PointSystem.Instance.CurrentLeader()) >= 200) { SceneManager.LoadSceneAsync("winning-scene"); } else { SceneManager.LoadSceneAsync(SwitchScene.Instance.GetLevel()); } } }
private void Awake() { this.canvasGroup = this.GetComponent <CanvasGroup>(); PointsSummary.instance = this; }
[DllImport("usdi")] public static extern void usdiPointsGetSummary(Points points, ref PointsSummary dst);