示例#1
0
    public void PointOfInterestWithEvents_OnPointOfInterestEntered(PointOfInterestWithEvents poi)
    {
        string achievementKey = "achivement-" + poi.PoiName;

        if (PlayerPrefs.GetInt(achievementKey) == 1)
        {
            return;
        }
        PlayerPrefs.SetInt(achievementKey, 1);
        Debug.Log("Unlocked " + poi.PoiName);
    }
    private void PointOfInterestWithEvents_OnPointOfInterestEntered(PointOfInterestWithEvents poi)
    {
        string achievementKey = "Achievement " + poi.Poiname;

        string key;

        if (poi.Poiname.Equals("Cookies event"))
        {
            cookiesEvent.OnMatch();
            if (cookiesEvent.AchievementCompleted())
            {
                key = "Match first cookies";
                NotifyAchievement(key, poi.Poiname);
            }
        }

        if (poi.Poiname.Equals("Cake event"))
        {
            cakeEvent.OnMatch();
            if (cakeEvent.AchievementCompleted())
            {
                key = "Match 10 cake";
                NotifyAchievement(key, poi.Poiname);
            }
        }

        if (poi.Poiname.Equals("Gum event"))
        {
            gumEvent.OnMatch();
            if (gumEvent.AchievementCompleted())
            {
                key = "Match 5 gum";
                NotifyAchievement(key, poi.Poiname);
            }
        }
    }