private void Awake()
 {
     if (virtualCurrencyBalanceProvider.GetValue() != null)
     {
         return;
     }
     Debug.LogAssertion("VirtualCurrencyBalancePrefab is missing!");
     Destroy(gameObject);
 }
        private AttributeItem InstantiateAttribute(UserAttribute userAttribute, bool isReadOnly, Transform parentTransform)
        {
            var attributeItemObject = Instantiate <GameObject>(AttributeItemProvider.GetValue(), parentTransform);
            var attributeItem       = attributeItemObject.GetComponent <AttributeItem>();

            attributeItem.IsReadOnly = isReadOnly;
            attributeItem.IsPublic   = userAttribute.permission != "private";
            attributeItem.Key        = userAttribute.key;
            attributeItem.Value      = userAttribute.value;

            return(attributeItem);
        }
Exemplo n.º 3
0
        private void RefreshUsersContainer(List <FriendModel> users)
        {
            var addedUsers       = new List <FriendModel>();
            var createdFriendUIs = new List <FriendUI>();

            usersContainer.Clear();
            users.ForEach(newUser =>
            {
                int index;
                if ((index = addedUsers.IndexOf(newUser)) != -1)                //This will be true for Xsolla users with several social networks linked
                {
                    createdFriendUIs[index].AddSocialFriendshipMark(newUser.SocialProvider);
                }
                else
                {
                    var friendUiGameObject = usersContainer.AddItem(userPrefabProvider.GetValue());
                    var friendUiScript     = friendUiGameObject.GetComponent <FriendUI>();
                    friendUiScript.Initialize(newUser);

                    addedUsers.Add(newUser);
                    createdFriendUIs.Add(friendUiScript);
                }
            });

            if (usersContainer.IsEmpty())
            {
                usersContainer.EnableEmptyContainerMessage();
            }
            else
            {
                usersContainer.DisableEmptyContainerMessage();
            }
        }
        private void RefreshUsers(string group, bool isOnGroupSelect)
        {
            var users = FriendsMenuHelper.GetUsersByGroup(group);

            users = FilterUsersByStartWord(users, userSearchBox.text);

            usersContainer.Clear();

            if (users != null && users.Count > 0)
            {
                if (isOnGroupSelect)
                {
                    userSearchBox.gameObject.SetActive(true);
                }

                DisableEmptyGroupMessages();
                users.ForEach(u =>
                {
                    var go = usersContainer.AddItem(userPrefabProvider.GetValue());
                    go.GetComponent <FriendUI>().Initialize(u);
                });
            }
            else if (isOnGroupSelect)
            {
                userSearchBox.gameObject.SetActive(false);
                EnableEmptyGroupMessage(group);
            }
        }
        private void RefreshUsersContainer(List <FriendModel> users)
        {
            usersContainer.Clear();
            users.ForEach(u =>
            {
                var go = usersContainer.AddItem(userPrefabProvider.GetValue());
                go.GetComponent <FriendUI>().Initialize(u);
            });

            if (users.Count > 0)
            {
                SwitchUI(UIState.Search);
            }
            else
            {
                SwitchUI(UIState.EmptySearchResult);
            }
        }