public AchievmentInfo(AchievmentData data) { this.data = data; Id = data.id; Count = 0; Tier = 0; RewardTier = NO_REWARD_TIER; }
public void UnlockAchievment(AchievmentType type, string value) { AchievmentData achievment = _achievmentList.Find(a => a.Type == type && a.Value == value); if (achievment != null && !achievment.isUnlocked) { achievment.isUnlocked = true; ShowAchievmentPopUp(achievment); } Debug.Log("istrigger"); }
public AchievmentInfo GetAchievment(AchievmentData data) { if (HasAchievment(data)) { return(achievments[data.id]); } else { achievments.Add(data.id, new AchievmentInfo(data)); return(achievments[data.id]); } }
private void ShowAchievmentPopUp(AchievmentData achievment) { _popUpText.text = achievment.Title; _popUpShowDurationControl = _popUpShowDuration; //_popUpTransform.localScale = Vector2.right; }
public bool IsTierUnlocked(AchievmentData data, int tier) { return(GetAchievment(data).IsUnlocked(tier)); }
public bool HasAchievment(AchievmentData data) { return(achievments.ContainsKey(data.id)); }
public static void OnAchievmentRewarded(AchievmentData achievmentData, AchievmentTierData tierData) { AchievmentRewarded?.Invoke(achievmentData, tierData); }
public void Setup(AchievmentData data) { IAchievmentService service = engine.GetService <IAchievmentService>(); iconImage.overrideSprite = service.IsTierUnlocked(data, tier) ? openedSprite : closedSprite; }