示例#1
0
        private static void LoadBuddyListNames()
        {
            //get the buddy list from the session
            AccCoreLib.IAccBuddyList bl = accSess.BuddyList;

            //list of users
            List <String> lst = new List <string>();

            //iterate groups
            for (int i = 0; i < bl.GroupCount; i++)
            {
                //iterate names in the group
                for (int j = 0; j < bl.GetGroupByIndex(i).BuddyCount; j++)
                {
                    //get user
                    IAccUser user = bl.GetGroupByIndex(i).GetBuddyByIndex(j);

                    //add user to dictionary
                    lst.Add(user.Name);
                }
            }

            //raise the NamesLoaded event
            if (NamesLoaded != null)
            {
                NamesLoaded.Invoke(lst);
            }
        }
示例#2
0
        private void Start()
        {
            var json      = Resources.Load <TextAsset>(_jsonName);
            var jsonNames = JsonUtility.FromJson <JsonNames>(json.text);

            _names = jsonNames.names;
            NamesLoaded?.Invoke(this);
        }