Exemple #1
0
        private UIEntity CreateEntity(Entity entity)
        {
            var uiEntity = new UIEntity(entity, this);

            _trackedEntities.Add(entity.Id, uiEntity);
            return(uiEntity);
        }
Exemple #2
0
            public ItemPanelContainer(Director director, GameObject go, int containerIndex, ItemContainer itemContainer = null, bool proxyItem = true)
            {
                _director           = director;
                _containerBehaviour = go.GetComponent <ItemContainerBehaviour>();
                ItemContainer       = itemContainer;
                if (itemContainer != null)
                {
                    _containerBehaviour.Initialize(ItemContainer, _director, containerIndex, null);
                }

                _itemEntity = new UIEntity(nameof(Item), "ItemPanelProxy", director);
                director.AddUntrackedEntity(_itemEntity);
                _itemEntity.GameObject.transform.SetParent(_director.ItemPanel.transform, false);
                _itemEntity.GameObject.RectTransform().anchorMin        = _containerBehaviour.RectTransform().anchorMin;
                _itemEntity.GameObject.RectTransform().anchorMax        = _containerBehaviour.RectTransform().anchorMax;
                _itemEntity.GameObject.RectTransform().anchoredPosition = _containerBehaviour.RectTransform().anchoredPosition;
                _itemEntity.GameObject.RectTransform().sizeDelta        = _containerBehaviour.RectTransform().sizeDelta;
                _itemEntity.GameObject.SetActive(false);

                _proxyItem = proxyItem;
            }
Exemple #3
0
 public bool TryGetEntity(int id, out UIEntity uiEntity)
 {
     return(_trackedEntities.TryGetValue(id, out uiEntity));
 }
Exemple #4
0
 public void AddUntrackedEntity(UIEntity uiEntity)
 {
     _untrackedEntities.Add(uiEntity);
 }