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; } }
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)); } } }