private void OutOfAnchors(TypeForAnchor anchorType) { ProductPanel[] panels; if (anchorType == TypeForAnchor.SpawnObject) { panels = _productPanels.Where(a => a.ProductType == ActionObjectType.Spawn).ToArray(); } else { panels = _productPanels.Where(a => IsActionObject(a.ProductType)).ToArray(); } if (panels != null) { for (int i = 0; i < panels.Length; i++) { panels[i].ClosePanel(); } } }
protected void OnOutOfAnchors(TypeForAnchor anchorType) => OutOfAnchors?.Invoke(anchorType);