Ejemplo n.º 1
0
        internal void Setup(AIPowerCellSocketController mono)
        {
            _mono = mono;

            _pageStateHash = UnityEngine.Animator.StringToHash("PageState");

            if (FindAllComponents())
            {
                StartCoroutine(CompleteSetup());
            }
            else
            {
                QuickLogger.Error("// ============== Error getting all Components ============== //");
            }
        }
        internal void Initialize(AIPowerCellSocketController mono)
        {
            _mono = mono;
            StartCoroutine(UpdatePowerRelay());
            InvokeRepeating("UpdateSlots", 1f, 0.5f);
            if (_containerRoot == null)
            {
                QuickLogger.Debug("Initializing Filter StorageRoot");
                var storageRoot = new GameObject("FilterStorageRoot");
                storageRoot.transform.SetParent(transform, false);
                _containerRoot = storageRoot.AddComponent <ChildObjectIdentifier>();
            }

            _batteryContainer = new ItemsContainer(ContainerWidth, ContainerHeight, _containerRoot.transform,
                                                   AIPowerCellSocketBuildable.PowercellContainterLabel(), null);

            _batteryContainer.isAllowedToAdd += IsAllowedToAdd;
            _batteryContainer.onAddItem      += BatteryContainerOnOnAddItem;
            _batteryContainer.onRemoveItem   += BatteryContainerOnOnRemoveItem;
        }