Beispiel #1
0
    int getAchievementStageReached(achievementConfig ac)
    {
        int maxStage = -1;

        for (int i = 0; i < ac.achievementStages.Length; i++)
        {
            if (ac.achievementCnt >= ac.achievementStages[i].achievementTarget)
            {
                maxStage = i;
            }
        }
        return(maxStage);
    }
Beispiel #2
0
 void showAchievementAnimation(achievementConfig ac)
 {
     if (achievementAnimator != null)
     {
         if (anim_descriptionText != null)
         {
             anim_descriptionText.text = TranslationManager.translateIfAvail(ac.description);
         }
         if (anim_titleText != null)
         {
             anim_titleText.text = TranslationManager.translateIfAvail(ac.title);
         }
         if (anim_achievementImage != null)
         {
             anim_achievementImage.sprite = ac.sprite;
         }
         achievementAnimator.SetTrigger(triggerOnAchievement);
     }
 }
Beispiel #3
0
    void showAchievementAnimation(achievementConfig ac)
    {
        int stage = getAchievementStageReached(ac);

        if (achievementAnimator != null)
        {
            if (anim_descriptionText != null)
            {
                anim_descriptionText.text = TextReplacement.TranslateAndReplace(ac.achievementStages[stage].description);
            }
            if (anim_titleText != null)
            {
                anim_titleText.text = TextReplacement.TranslateAndReplace(ac.achievementStages[stage].title);
            }
            if (anim_achievementImage != null)
            {
                anim_achievementImage.overrideSprite = ac.achievementStages[stage].sprite;
            }
            achievementAnimator.SetTrigger(triggerOnAchievement);
        }
    }