Beispiel #1
0
        public GameObject Build()
        {
            this.userLabelInstance.SetActive(true);
            Entity             entity    = this.userLabelInstance.GetComponent <EntityBehaviour>().Entity;
            UserLabelComponent component = this.userLabelInstance.GetComponent <UserLabelComponent>();

            if (!component.SkipLoadUserFromServer)
            {
                entity.AddComponent(new LoadUserComponent(component.UserId));
            }
            else if (!entity.HasComponent <UserGroupComponent>())
            {
                entity.AddComponent(new UserGroupComponent(component.UserId));
            }
            else if (entity.GetComponent <UserGroupComponent>().Key != component.UserId)
            {
                entity.RemoveComponent <UserGroupComponent>();
                entity.AddComponent(new UserGroupComponent(component.UserId));
            }
            LeagueBorderComponent componentInChildren = this.userLabelInstance.GetComponentInChildren <LeagueBorderComponent>();

            if (componentInChildren != null)
            {
                componentInChildren.gameObject.SetActive(this.withLeague);
            }
            return(this.userLabelInstance);
        }
Beispiel #2
0
        public void RemoveTeammate(long id)
        {
            UserLabelComponent[] componentsInChildren = this.teammatesList.GetComponentsInChildren <UserLabelComponent>(true);
            int index = 0;

            while (true)
            {
                if (index < componentsInChildren.Length)
                {
                    UserLabelComponent component = componentsInChildren[index];
                    if (component.UserId != id)
                    {
                        index++;
                        continue;
                    }
                    Destroy(component.gameObject);
                }
                return;
            }
        }