Example #1
0
    /// <summary>
    /// 처음 게임을 킬 때 업적들 목록 생성.
    /// </summary>
    /// <param name="parent">객체가 생성될 위치</param>
    /// <param name="title">업적제목</param>
    /// <param name="description">업적내용</param>
    /// <param name="points">업적포인트</param>
    /// <param name="spriteIndex">사실상 노필요..</param>
    public void CreateAchievment(string parent, string achievmentContent, string title, string description, int points, int spriteIndex, string[] dependencies = null, GameObject _uiAchievment = null)
    {
        GameObject achievment    = (GameObject)Instantiate(achievmentPrefab);   // 업적 내용 프리팹 클론복사.
        Achievment newAchievment = new Achievment(achievmentContent, title, description, points, spriteIndex, achievment);

        achievments.Add(title, newAchievment);
        SetAchievmentInfo(parent, achievment, title);

        if (dependencies != null)
        {
            foreach (string achievmentTitle in dependencies)
            {
                Achievment dependency = achievments[achievmentTitle];
                dependency.Child = title;
                newAchievment.AddDependency(achievments[achievmentTitle]);

                // Dependency = Press Space <-- Child = Press W
                // NewAchievment = Press W --> Press Space
            }
        }

        if (_uiAchievment != null)
        {
            _uiAchievment.SetActive(false);
        }
    }
Example #2
0
    public void CreateAchievment(string parent, string title, string description, int points, int spriteIndex, int progress, string[] dependencies = null)
    {
        GameObject achievment    = Instantiate(achievmentPrefab) as GameObject;
        Achievment newAchievment = new Achievment(title, description, points, spriteIndex, achievment, progress);

        achievments.Add(title, newAchievment);
        SetAchievmentInfo(parent, achievment, title, progress);
        if (dependencies != null)
        {
            foreach (string achievmentTitle in dependencies)
            {
                Achievment dependency = achievments[achievmentTitle];
                dependency.SetChild(title);
                newAchievment.AddDependency(achievments[achievmentTitle]);
                // dependency = press space <-- child = press w
                // new achie = press w --> press space
            }
        }
    }
    public void CreateAchievment(string parent, string title, string description, int points, int spriteIndex, string[] dependencies = null) //This will be a function to make a string category to put the achievment under and to find the parent along with adding the title description and points for the achievment
    {
        GameObject achievment = (GameObject)Instantiate(achivementPrefab);                                                                   //This will be making a new achievment

        Achievment newAchievment = new Achievment(name, description, points, spriteIndex, achievment);

        achievments.Add(title, newAchievment);

        SetAchievmentInfo(parent, achievment, title); //For this im adding the category with the title description and points from the achievment info function

        if (dependencies != null)
        {
            foreach (string achievmentTitle in dependencies)
            {
                Achievment dependency = achievments[achievmentTitle];
                dependency.Child = title;
                newAchievment.AddDependency(achievments[achievmentTitle]);
            }
        }
    }
Example #4
0
    public void CreateAchievment(string parent, string title, string description, int points, string[] dependencies = null)
    {
        GameObject achievment    = (GameObject)Instantiate(achievmentPrefab);           // Kanoume instantiate to achievment
        Achievment newAchievment = new Achievment(title, description, points, achievment, title);

        achievments.Add(title, newAchievment);                                                                                                                          // Vaozume to achievment sto dictionery;
        SetAchievmentInfo(parent, achievment, title);                                                                                                                   // Kaloume tin methodo gia na thesoume ta infos tou achievment

        if (dependencies != null)
        {
            foreach (string achievmentTitle in dependencies)                                                                                                    // Psaxnoume ston pinaka me ta string
            {
                Achievment dependency = achievments [achievmentTitle];                                                                                          // Dimiourgoume ena achievment me vasi auto poy yparxei ston pinaka.
                dependency.Child = title;                                                                                                                       // Orizoume to child ston title tou achiev;
                newAchievment.AddDependency(dependency);

                //Dependency = Press Space <-- Child = Press W			Dimiourgoume mia sxesi parent kai child
                // NewAchievemnt = Press W --> Press Space
            }
        }
    }
Example #5
0
    public void createAchievment(string parent, string title, string description, int points, int spriteIndex, int progress, string[] dependencies = null)
    {
        GameObject achievment = (GameObject)Instantiate(achievmentPrefab); //instantiate achievment prefab

        Achievment newAchivment = new Achievment(title, description, points, spriteIndex, achievment, progress);

        achievments.Add(title, newAchivment); //add the achievment to dictionary

        setAchievmentInfor(parent, achievment, title, progress);

        if (dependencies != null)
        {
            foreach (string achievmentTitle in dependencies)
            {
                Achievment dependency = achievments[achievmentTitle];
                dependency.Child = title;
                newAchivment.AddDependency(dependency);

                //Dependency = Press Space <-- Press W
                //New Achievment = Press W --> Press Space
            }
        }
    }