public SlotItem[,] BuildShip(ShipScriptableObject shipShape) { currentShape = shipShape; slotGrid = new SlotItem[currentShape.Height, currentShape.Width]; ResizePanel(); CreateSlots(); return(slotGrid); }
public void CreateShip(ShipScriptableObject ship) { foreach (Transform child in modulesHolder) { Destroy(child.gameObject); } slotGrid = shipBuilder.BuildShip(ship); gridSize = new int2(ship.Width, ship.Height); }
public void SetUpButton(ShipScriptableObject ship, Action <ShipButton> onButtonPressed) { button.onClick.RemoveAllListeners(); icon.overrideSprite = ship.Icon; nameText.text = ship.Name; Ship = ship; CompressedGrid = null; button.onClick.AddListener(() => onButtonPressed?.Invoke(this)); }