Пример #1
0
        public override void Open()
        {
            base.Open();

            if (AllNames.Count == 0)
            {
                PYNamesManager.LoadNames(NamesLoaded);
            }
            else
            {
                if (State != OpenableState.Opened)
                {
                    OpenWindow();
                }
                if (_itensCreated)
                {
                    ShowListView(NamesManagerPopup.Instance.TypedName);
                }
                else
                {
                    AnimateListEnter(() => StartCoroutine("UpdateListNamesRoutine", FilterNames()));
                }
            }

            Opened();
        }
Пример #2
0
 private void Update()
 {
     if (Input.GetKey(KeyCode.N) && Input.GetKeyDown(KeyCode.D))
     {
         print("Delete all Names forced");
         PYNamesManager.DeleteAll(true);
     }
 }
Пример #3
0
        private void KeyboardEntry(NamesManagerPopup.PlayerInfo[] names)
        {
            if (names != null && names[0] != null)
            {
                RegisterInfo.Name    = names[0].Name;
                RegisterInfo.ClassId = names[0].ClassId;
            }

            NameRegistred.Text = RegisterInfo.Name;
            PYNamesManager.SaveName(RegisterInfo.Name, RegisterInfo.ClassId);
        }
Пример #4
0
        public static void RegisterStudent(Student student, int classId)
        {
            Student st = Students.Find(s => s.Name == student.Name);

            if (st == null)
            {
                Students.Add(student);
            }
            //else
            //student.Update(student);

            PYNamesManager.SaveName(student.Name, classId);
            Save();
        }
Пример #5
0
        public static void RegisterStudent(string name, int classId, int score = 0)
        {
            Student student = Students.Find(s => s.Name == name);

            if (student == null)
            {
                Students.Add(new Student(name, score));
            }
            else
            {
                student.SetScore(score);
            }

            PYNamesManager.SaveName(name, classId);
            Save();
        }
Пример #6
0
        public static void RegisterStudent(string name, int score = 0, TagManager.GameDifficulty difficulty = TagManager.GameDifficulty.Easy, int classId = 0)
        {
            Student student = Students.Find(s => s.Name == name);

            if (student == null)
            {
                Students.Add(new Student(name, score, difficulty));
            }
            else
            {
                student.SetScore(score, difficulty);
            }

            PYNamesManager.SaveName(name, classId);
            Save();
        }
Пример #7
0
        public static void Initialize()
        {
            //PYNamesManager.DeleteAll();
            //DeleteAll();

            PYNamesManager.Initialize();
            Load();

            achievementVisualObject = GameObject.FindGameObjectWithTag(Tags.achievementVisualObject);

            if (achievementVisualObject != null)
            {
                achievementVisualController = achievementVisualObject.GetComponent <AchievementVisualController> ();
            }

            synchronizedTheScores = true;
        }
Пример #8
0
        // Use this for initialization
        void Start()
        {
            PYNamesManager.Initialize();

            if (PYBundleManager.Instance.IsReady)
            {
                Load();
            }
            else
            {
                PYBundleManager.Instance.onLoadCompleted.AddListener((data) =>
                {
                    Invoke("Load", 0.5f);

                    // Load Icon from all contents
                    //List<ContentAsset<Sprite>> icons = PYBundleManager.Content.GetAssetsFromAllContents<Sprite>("Icon");
                    //foreach (ContentAsset<Sprite> i in icons)
                    //{
                    //    Debug.Log(i.BundleName + " : " + i.Asset + " : IsBundleReadable: " + i.BundleData.Version.IsReadable);
                    //}

                    // Select multi contents and load a file from them
                    //PYBundleManager.Content.SetCurrentContents(icons[0].BundleName, icons[2].BundleName);
                    //List<ContentAsset<TextAsset>> question = PYBundleManager.Content.GetAssets<TextAsset>("Questions");
                    //foreach (ContentAsset<TextAsset> t in question)
                    //{
                    //    Debug.Log(t.Asset.text.Split('\n')[0]);
                    //}

                    // Reload all content manager and load new assets again
                    //Debug.Log("Temp:");
                    //PYBundleManager.Content.ReloadAll(() =>
                    //    {
                    //        Debug.Log("Reloaded");
                    //        List<ContentAsset<Sprite>> iconss = PYBundleManager.Content.GetAssetsFromAllContents<Sprite>("Icon");
                    //        foreach (ContentAsset<Sprite> i in iconss)
                    //        {
                    //            Debug.Log(i.BundleName + " : " + i.Asset + " : IsBundleReadable: " + i.BundleData.Version.IsReadable);
                    //        }
                    //    });
                });
            }
        }
Пример #9
0
 private void NamesRegistred(NamesManagerPopup.PlayerInfo[] names)
 {
     if (names != null && names.Length > 0)
     {
         for (int i = 0; i < names.Length; i++)
         {
             if (names[i] != null)
             {
                 Players[i].Name    = names[i].Name;
                 Players[i].ClassId = names[i].ClassId;
                 PYNamesManager.SaveName(Players[i].Name, Players[i].ClassId);
             }
             else
             {
                 Players[i].Name    = "Anônimo";
                 Players[i].ClassId = 0;
             }
             _nameHolder.Text += Players[i].ToString() + "\n";
             playerLogButton.Clicked(Players [i].Name, Players [i].ClassId, gameObject);
         }
     }
 }
Пример #10
0
 public static void DeleteAll()
 {
     Students = new List <Student>();
     PYNamesManager.DeleteAll();
     Save();
 }
Пример #11
0
 public static string[] GetStudentNames()
 {
     return(PYNamesManager.GetNames());
 }
Пример #12
0
 private void ClearAllNames(PYButton btn)
 {
     PYNamesManager.DeleteAll();
 }