protected void Awake() { currentLookup = defaultCopyToContainer; foreach (var lookup in copyToContainers) { var l = lookup; // Temp lookup.window.OnShow += () => { WindowOnOnShow(l); }; } switch (defaultLayout) { case LayoutChoice.DynamicGrid: _ChangeToGridLayoutDoSettings(); break; case LayoutChoice.Vertical: ChangeToVerticalLayout(); break; default: throw new ArgumentOutOfRangeException(); } }
public EntityDatabase(IEntityCollectionFactory entityCollectionFactory) { EntityCollectionFactory = entityCollectionFactory; _collections = new CollectionLookup(); _collectionSubscriptions = new Dictionary <int, IDisposable>(); _onCollectionAdded = new Subject <IEntityCollection>(); _onCollectionRemoved = new Subject <IEntityCollection>(); _onEntityAdded = new Subject <CollectionEntityEvent>(); _onEntityRemoved = new Subject <CollectionEntityEvent>(); _onEntityComponentsAdded = new Subject <ComponentsChangedEvent>(); _onEntityComponentsRemoving = new Subject <ComponentsChangedEvent>(); _onEntityComponentsRemoved = new Subject <ComponentsChangedEvent>(); }
private void WindowOnOnShow(CollectionLookup lookup) { foreach (Transform child in currentLookup.container.transform) { child.SetParent(lookup.container.transform); var rect = child.GetComponent <RectTransform>(); rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.one; rect.sizeDelta = Vector2.zero; rect.anchoredPosition = Vector2.zero; } currentLookup = lookup; }
public EntityCollectionManager(IEntityCollectionFactory entityCollectionFactory, IObservableGroupFactory observableGroupFactory, IComponentTypeLookup componentTypeLookup) { EntityCollectionFactory = entityCollectionFactory; ObservableGroupFactory = observableGroupFactory; ComponentTypeLookup = componentTypeLookup; _observableGroups = new ObservableGroupLookup(); _collections = new CollectionLookup(); _collectionSubscriptions = new Dictionary <int, IDisposable>(); _onCollectionAdded = new Subject <IEntityCollection>(); _onCollectionRemoved = new Subject <IEntityCollection>(); _onEntityAdded = new Subject <CollectionEntityEvent>(); _onEntityRemoved = new Subject <CollectionEntityEvent>(); _onEntityComponentsAdded = new Subject <ComponentsChangedEvent>(); _onEntityComponentsRemoving = new Subject <ComponentsChangedEvent>(); _onEntityComponentsRemoved = new Subject <ComponentsChangedEvent>(); CreateCollection(PoolLookups.DefaultPoolId); }