Beispiel #1
0
    public void AddAchievementToUI(AchievementInfromation Achievement, AchievementState State)
    {
        UIAchievement UIAchievement = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity).GetComponent <UIAchievement>();

        UIAchievement.Set(Achievement, State);
        UIAchievement.transform.SetParent(scrollContent.transform);
    }
    private void AddAchievements(string Filter)
    {
        foreach (Transform child in scrollContent.transform)
        {
            Destroy(child.gameObject);
        }
        AchievementManager AM = AchievementManager.instance;
        int AchievedCount     = AM.GetAchievedCount();

        CountText.text    = "" + AchievedCount + " / " + AM.States.Count;
        CompleteText.text = "Complete (" + AM.GetAchievedPercentage() + "%)";

        for (int i = 0; i < AM.AchievementList.Count; i++)
        {
            if (!AM.AchievementList[i].Spoiler || AM.States[i].Achieved)
            {
                if ((Filter.Equals("All")) || (Filter.Equals("Achieved") && AM.States[i].Achieved) || (Filter.Equals("Unachieved") && !AM.States[i].Achieved))
                {
                    UIAchievement Achievement = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity).GetComponent <UIAchievement>();
                    Achievement.Set(AM.AchievementList[i], AM.States[i]);
                    Achievement.transform.SetParent(scrollContent.transform);
                }
            }
        }
        Scrollbar.value = 1;
    }
Beispiel #3
0
 private void Awake()
 {
     start_button       = UIUtil.FindChild <Button>(transform, "UI/StartButton");
     setting_button     = UIUtil.FindChild <Button>(transform, "UI/SettingButton");
     reset_button       = UIUtil.FindChild <Button>(transform, "UI/ResetButton");
     achievement_button = UIUtil.FindChild <Button>(transform, "UI/AchievementButton");
     ui_achievement     = UIUtil.FindChild <UIAchievement>(transform, "UI/UIAchievement");
 }