コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: EntityDatabase.cs プロジェクト: redchew-fork/ecsrx
        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>();
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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);
        }