Пример #1
0
        protected override void OnDataUpdate(SettingsCategoryData data)
        {
            if (CurrentPanel == null)
            {
                DisplayedName = data.DisplayedName;
                TranslationId = data.TranslationId;
            }

            OnDisplayedNameUpdate();

            if (data.Panel != previousPanelPath)
            {
                previousPanelPath = data.Panel;
                panelContainer?.Dispose();
                panelContainer = ContainerPool.FromPresentation <SettingsPanelPresentationBase.BackendBase, SettingsPanelPresentationBase>(
                    data.Panel
                    );
                panelContainer.Add().ContinueWith(args =>
                {
                    var(element, _) = args;

                    CurrentPanel  = element;
                    DisplayedName = CurrentPanel.Name;
                    TranslationId = CurrentPanel.Translation;

                    OnDisplayedNameUpdate();
                });
            }
        }
        private void Awake()
        {
            settingsContainer = ContainerPool.FromPresentation <SettingsScreen.BackendBase, SettingsScreen>(settingsReference)
                                .WithTransformRoot(screenStackRoot.transform);
            settingsContainer.Add().ContinueWith(args =>
            {
                var backend = args.element.Backend;
                backend.DstEntityManager.AddComponent <UIScreen>(backend.BackendEntity);

                args.element.gameObject.SetActive(false);

                var folder = AddressBuilder.Client()
                             .Interface()
                             .Menu()
                             .Folder("Screens")
                             .Folder("SettingsScreen");
                args.element.Data = new SettingsScreenData
                {
                    Panels = new[]
                    {
                        folder.GetAsset("GraphicSettingsPanel"),
                        folder.GetAsset("AudioSettingsPanel")
                    }
                };
            });
        }
Пример #3
0
        protected override void OnAdded(UnitOverviewCategoryRow item, int2 position)
        {
            itemMap[position.x] = item;

            item.SetViewContainer(row => ContainerPool.FromPresentation <UIOverviewModuleBackend, UIOverviewModuleBase>(row.viewPath));
            item.ViewContainer.Warm();
            item.ViewContainer.onCollectionUpdate.AddListener(collection =>
            {
                foreach (var view in collection)
                {
                    view.Data = new ModuleViewData
                    {
                        QuitView          = () => CurrentlySelectedId = null,
                        CategoryTransform = GetAt(position).transform
                    };
                }
            });
        }
Пример #4
0
 private void Awake()
 {
     panelIndex        = -1;
     categoryContainer = ContainerPool.FromPresentation <SettingsCategoryPresentation.Backend, SettingsCategoryPresentation>(categoryReference)
                         .WithTransformRoot(categoryRoot);
 }