Example #1
0
 // Use this for initialization
 public void Start()
 {
     myAchievement = (!isIncremental) ?
                     new BasicAchievement(key, myName, description, lockedTexture, unlockedTexture) :
                     new BasicAchievement(key, myName, description, lockedTexture, unlockedTexture, goal);
     if (string.IsNullOrEmpty(myAchievement.Name))
     {
         this.gameObject.SetActive(false);
         return;
     }
     AchievementManager.AddAchievement(myAchievement);         //Add Achievement to system.
     Refresh();
 }
    // Use this for initialization
    void Start()
    {
        Achievement test = new Achievement
        {
            Id            = "ThreeCoins",
            IsUnlocked    = true,
            Trigger       = () => { return(PlayerInventory.Coins >= 3); },
            Title         = "Money money money. Literally.",
            Condition     = "Collect 3 coins",
            RewardMessage = "Death unlocked!",
            Reward        = () => { AchievementManager.CanDie = true; }
        };

        AchievementManager.AddAchievement(test);
    }
Example #3
0
        void Start()
        {
            //var properties = typeof(PlayerMovementAchievements).GetMethods(BindingFlags.DeclaredOnly |
            //                                                                BindingFlags.Instance |
            //                                                                BindingFlags.Public);

            Achievement test = new Achievement
            {
                Id            = "MoveLeft",
                IsUnlocked    = true,
                Trigger       = CanMoveRightCheck,
                Title         = "Every adventure starts with a lot of nothing",
                Condition     = "Do nothing for 5 seconds",
                RewardMessage = "Move Right unlocked",
                Reward        = () => { _achievementManager.CanMoveRight = true; }
            };

            _achievementManager.AddAchievement(test);
        }
Example #4
0
        public static void InitializeAchievements()
        {
            AchievementManager.ClearAchievements();

            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 0, Name = "Be the Crow!", Description = "Use the Crow client for the first time."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 1, Name = "Poopy", Description = "Use a poop emoji for the first time."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 2, Name = "Eye Spy", Description = "Use an eyes emoji for the first time."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 3, Name = "Level Up!", Description = "Gain your first level."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 4, Name = "Farewell!", Description = "Release your first recruit."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 5, Name = "Quitter", Description = "Escape from a dungeon."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 6, Name = "Sailor Mouth", Description = "Arrgh! Use inappropriate language."
            });
            AchievementManager.AddAchievement(new Achievement()
            {
                ID = 7, Name = "Eggcited Shiny", Description = "Hatch a shiny egg!"
            });
        }
Example #5
0
 /// <summary>
 /// 添加成就
 /// </summary>
 /// <param name="dto"></param>
 /// <returns></returns>
 public JsonResult DoAdd(AchievementDto dto)
 {
     dto.creator = TaskWebSession.id;
     return(achievementManager.AddAchievement(dto) ?
            resultManager.SuccessResult() : resultManager.FailureResult());
 }