public void AddDependency(Achievment dependency)
 {
     dependencies.Add(dependency);
 }
Example #2
0
 public Achievment GetAchievment(int id)
 {
     achievment = CustomCatalog[id];
     return(achievment);
 }
Example #3
0
 public int getAchievementLevel(Achievment pAchievment)
 {
     return(_achievmentLevel[pAchievment]);
 }
Example #4
0
 private void Start()
 {
     achieve = GameObject.FindGameObjectWithTag("Steam").GetComponent <Achievment>();
 }
Example #5
0
    public override void OnInspectorGUI()
    {
        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
        if (achievmentFile != null)
        {
            EditorGUILayout.BeginVertical(subGroupStyle);

            //HEADER.
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal(rootGroupStyle);
            GUILayout.FlexibleSpace();  EditorGUILayout.LabelField("ACHIEVEMENTS EDITOR", EditorStyles.boldLabel); GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();
            //END HEADER.

            EditorGUILayout.BeginHorizontal(subGroupStyle);
            achievmentFile.language = (Locale)EditorGUILayout.ObjectField("Language File", achievmentFile.language, (typeof(Locale)), false);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            if (achievmentFile.achievmentsList != null)
            {
                EditorGUILayout.BeginVertical(rootGroupStyle);

                //ADD ACHIEVEMENTS.
                EditorGUILayout.BeginHorizontal(subGroupStyle);
                GUILayout.FlexibleSpace(); EditorGUILayout.LabelField("Achievements");
                GUILayout.FlexibleSpace(); if (StyledButton("Add Achievement"))
                {
                    Add();
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                //END ADD ACHIEVEMENTS.

                if (achievmentFile.achievmentsList.Count == 0)
                {
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace(); GUILayout.Label("FILE EMPTY"); GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    for (int a = 0; a < achievmentFile.achievmentsList.Count; a++)
                    {
                        Achievment ach = achievmentFile.achievmentsList[a];
                        EditorGUILayout.Space();
                        EditorGUILayout.BeginHorizontal(subGroupStyle);
                        ach.active = EditorGUILayout.Foldout(ach.active, ach.name, EditorStyles.foldout); if (GUILayout.Button("Remove"))
                        {
                            remove(a);
                        }
                        EditorGUILayout.EndHorizontal();
                        if (ach.active)
                        {
                            EditorGUILayout.BeginHorizontal(subGroupStyle);
                            ach.name = EditorGUILayout.TextField("Achievement:", ach.name.Trim());
                            EditorGUILayout.EndHorizontal();
                            //----------------------------------------------------
                            EditorGUILayout.BeginVertical(subGroupStyle);
                            ach.aid      = EditorGUILayout.TextField("Achievement ID:", ach.aid.Trim());
                            ach.gpid     = EditorGUILayout.TextField("Google Play ID:", ach.gpid.Trim());
                            ach.category = (AchievementsCategory)EditorGUILayout.EnumPopup("Category:", ach.category);
                            EditorGUIUtility.labelWidth = 180;
                            EditorGUILayout.LabelField("Icon:");
                            ach.icon = (Sprite)EditorGUILayout.ObjectField(ach.icon, typeof(Sprite), false);
                            //UNLOCK VALUES.
                            ach.unlockValueType = (UnlockValueType)EditorGUILayout.EnumPopup("Unlock Value Type:", ach.unlockValueType);
                            if (ach.unlockValueType == UnlockValueType.INTEGER)
                            {
                                ach.unlockValueInt = EditorGUILayout.IntField("Unlock Value:", ach.unlockValueInt);
                            }
                            if (ach.unlockValueType == UnlockValueType.STRING)
                            {
                                ach.unlockValueString = EditorGUILayout.TextField("Unlock Value:", ach.unlockValueString);
                            }
                            if (ach.unlockValueType == UnlockValueType.FLOAT)
                            {
                                ach.unlockValueFloat = EditorGUILayout.FloatField("Unlock Value:", ach.unlockValueFloat);
                            }
                            if (ach.unlockValueType == UnlockValueType.BOOLEAN)
                            {
                                ach.unlockValueBoolean = EditorGUILayout.Toggle("Unlock Value:", ach.unlockValueBoolean);
                            }
                            if (this.keyWords != null)
                            {
                                ach.title = EditorGUILayout.Popup("Title:", ach.title, this.keyWords);
                            }
                            if (this.keyWords != null)
                            {
                                ach.description = EditorGUILayout.Popup("Description:", ach.description, this.keyWords);
                            }
                            //----------------------------------------------------
                            EditorGUILayout.BeginHorizontal(titleStyle);
                            if (GUILayout.Button("Duplicate"))
                            {
                                duplicate(a);
                            }
                            if (GUILayout.Button("Move Up"))
                            {
                                moveUp(a);
                            }
                            if (GUILayout.Button("Move Down"))
                            {
                                moveDown(a);
                            }
                            EditorGUILayout.EndHorizontal();
                            EditorGUILayout.EndVertical();
                            //----------------------------------------------------
                        }
                    }
                }
                GUILayout.FlexibleSpace();      GUILayout.FlexibleSpace();
                EditorGUILayout.EndVertical();
            }
            else
            {
                achievmentFile.achievmentsList = new List <Achievment>();
            }
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();             //EV
        }
        else
        {
            GUILayout.Label("No file selected.");
        }
        EditorGUILayout.EndScrollView();
        EditorUtility.SetDirty(achievmentFile);
    }
Example #6
0
 public void AddGoal(int id)
 {
     achievment = catalogObject.GetAchievment(id);
     goalsList.Add(achievment);
     goalsList.RemoveAt(0);
 }