示例#1
0
        public override void Initialize()
        {
            if (FCSFilteredStorage == null)
            {
                QuickLogger.Info("Adding Filtered Storage");

                FCSFilteredStorage = gameObject.GetComponent <FCSFilteredStorage>();


                if (_data != null)
                {
                    QuickLogger.Info($"Server from Data: {_data?.Server}");
                    FCSFilteredStorage.Initialize(_data?.ServerFilters ?? new List <Filter>(), UpdateScreen);
                    FCSFilteredStorage.Items = _data?.Server ?? new HashSet <ObjectData>();
                }
                else if (_savedData != null)
                {
                    QuickLogger.Info($"Server from Save Data: {_savedData?.ServerData}");
                    FCSFilteredStorage.Initialize(_savedData?.Filters ?? new List <Filter>(), UpdateScreen);
                    FCSFilteredStorage.Items = _savedData?.ServerData ?? new HashSet <ObjectData>();
                }

                FCSFilteredStorage.OnFiltersUpdate += OnFiltersUpdate;
                FCSFilteredStorage.OnItemsUpdate   += OnItemsUpdate;
            }

            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <DSSServerDisplay>();
                DisplayManager.Setup(this);
            }

            IsInitialized = true;
        }
        public override void Initialize()
        {
            if (FCSFilteredStorage == null)
            {
                FCSFilteredStorage = gameObject.GetComponent <FCSFilteredStorage>();
                FCSFilteredStorage.Initialize(_data?.ServerFilters, UpdateScreen);
                FCSFilteredStorage.Items            = _data?.Server ?? new HashSet <ObjectData>();
                FCSFilteredStorage.OnFiltersUpdate += OnFiltersUpdate;
                FCSFilteredStorage.OnItemsUpdate   += OnItemsUpdate;
            }

            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <DSSServerDisplay>();
                DisplayManager.Setup(this);
            }

            IsInitialized = true;
        }