コード例 #1
0
 void Start()
 {
     if (groupsController != null)
     {
         FriendsMenuHelper.RefreshGroups(groupsController, FriendsMenuHelper.ADD_FRIENDS_GROUP);
         Action <string> groupChangedCallback = group =>
         {
             FriendsMenuHelper.RefreshGroups(groupsController, group);
             DemoController.Instance.SetState(MenuState.Friends);
         };
         groupsController.GroupSelectedEvent += _ => groupsController.GroupSelectedEvent -= groupChangedCallback;
         groupsController.GroupSelectedEvent += groupChangedCallback;
     }
 }
コード例 #2
0
 void Start()
 {
     if (groupsController != null)
     {
         groupsController.GroupSelectedEvent += group =>
         {
             if (group.Equals(FriendsMenuHelper.ADD_FRIENDS_GROUP))
             {
                 DemoController.Instance.SetState(MenuState.SocialFriends);
             }
             else
             {
                 userSearchBox.text = string.Empty;
                 RefreshUsers(group, isOnGroupSelect: true);
             }
         };
         FriendsMenuHelper.RefreshGroups(groupsController);
         if (userSearchBox != null)
         {
             userSearchBox.onValueChanged.AddListener(_ => RefreshUsers(groupsController.GetSelectedGroup().Name, isOnGroupSelect: false));
         }
     }
 }