コード例 #1
0
    public void ChangeCategory(GameObject button)
    {
        AchievmentButton achievmentButton = button.GetComponent <AchievmentButton>();

        scrollRect.content = achievmentButton.archievmentList.GetComponent <RectTransform>();
        achievmentButton.Click();
        activeButton.Click();

        activeButton = achievmentButton;
    }
コード例 #2
0
    public void ChangeCategory(GameObject button)
    {
        AchievmentButton achievmentButton = button.GetComponent <AchievmentButton> ();

        Debug.Log(button.name);
        scrollRect.content = activeButton.achievmentList.GetComponent <RectTransform>();        // Pernoume to rectTransform tis kathe katigorias pou exoume orisei sto kathe koubi
        achievmentButton.Click();                                                               // An to koubi itan energo tha to apenergopoiisoume
        activeButton.Click();                                                                   // kai orizoume nai active button wste na allaksoume to sprite;
        activeButton = achievmentButton;                                                        // Orizoume ws active button to teleuaio clicked button
    }
コード例 #3
0
 public void ChangeSprite(AchievmentButton activebutton)
 {
     for (int i = 0; i < achievmentDatabase.Count; i++)
     {
         if (achievmentDatabase [i].Category == activeButton.achievmentList.name && achievmentDatabase[i].Unlocked == true)
         {
             GameObject.Find(achievmentDatabase[i].Category).transform.FindChild(achievmentDatabase[i].Title).GetComponent <Image>().sprite = unlockedSprite;
         }
     }
 }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        activeButton = GameObject.Find("Summary_Button").GetComponent <AchievmentButton> ();
        activeButton.Click();
//		CreateAchievment ("General","Kill all","Kill everything on sight",50);
//		CreateAchievment ("General","Kill all2","Kill everything on sight",60,new string[]{"Kill All"} );



        foreach (GameObject achievmentList in GameObject.FindGameObjectsWithTag("AchievmentList"))                              // Apenergopoioume oles ti katigories pou den theloume afou exoume dimiourgisei ta achievment
        {
            achievmentList.SetActive(false);
        }
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        itemData = JsonMapper.ToObject(File.ReadAllText(Application.dataPath + "/StreamingAssets/Achievments.json"));
        ConstructAchievmentDatabase();
        activeButton = GameObject.Find("Summary_Button").GetComponent <AchievmentButton> ();
        activeButton.Click();

        foreach (GameObject achievmentList in GameObject.FindGameObjectsWithTag("AchievmentList"))                              // Apenergopoioume oles ti katigories pou den theloume afou exoume dimiourgisei ta achievment
        {
            achievmentList.SetActive(false);
        }

        //Debug.Log (achievmentDatabase [1].Title);
    }
コード例 #6
0
    // Start is called before the first frame update
    void Start()
    {
        activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievmentButton>();
        CreateAchievment("General", "Press W", "Press W to unlock this achievment", 5, 0); //This will create a new achievment on the general category along with a title and description with a number value that represents points then another value that represents the sprite position
        CreateAchievment("General", "Press S", "Press S to unlock this achievment", 5, 0);
        CreateAchievment("General", "All keys", "Press all keys to unlock this achievment", 10, 0, new string[] { "Press W", "Press S" });


        foreach (GameObject achievmentList in GameObject.FindGameObjectsWithTag("AchievmentList"))
        {
            achievmentList.SetActive(false);
        }

        activeButton.Click();

        achievmentMenu.SetActive(false);
    }
コード例 #7
0
    void Start()
    {
        PlayerPrefs.DeleteAll();
        activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievmentButton>();
        CreateAchievment("General", "Press W", "Press W to unlock", 5, 0, 0);
        CreateAchievment("General", "Press S", "Press S to unlock", 5, 0, 0);
        CreateAchievment("General", "All", "Press all to unlock", 10, 0, 0, new string[] { "Press W", "Press S" });
        CreateAchievment("General", "Press A", "Press A 3 time to unlock", 5, 0, 3);

        CreateAchievment("Other", "red", "Press Red to unlock", 5, 1, 0);
        CreateAchievment("Other", "yellow", "Press yel to unlock", 5, 1, 0);
        CreateAchievment("Other", "green", "Press gre to unlock", 5, 1, 0);

        foreach (GameObject achievmentList in GameObject.FindGameObjectsWithTag("AchievmentList"))
        {
            achievmentList.SetActive(false);
        }

        activeButton.Click();
        achievmentMenu.SetActive(false);
    }