Esempio n. 1
0
 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");
    }
Esempio n. 3
0
 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;
 }
Esempio n. 5
0
 public bool IsTierUnlocked(AchievmentData data, int tier)
 {
     return(GetAchievment(data).IsUnlocked(tier));
 }
Esempio n. 6
0
 public bool HasAchievment(AchievmentData data)
 {
     return(achievments.ContainsKey(data.id));
 }
Esempio n. 7
0
 public static void OnAchievmentRewarded(AchievmentData achievmentData, AchievmentTierData tierData)
 {
     AchievmentRewarded?.Invoke(achievmentData, tierData);
 }
Esempio n. 8
0
        public void Setup(AchievmentData data)
        {
            IAchievmentService service = engine.GetService <IAchievmentService>();

            iconImage.overrideSprite = service.IsTierUnlocked(data, tier) ? openedSprite : closedSprite;
        }