Esempio n. 1
0
 public SlotItem[,] BuildShip(ShipScriptableObject shipShape)
 {
     currentShape = shipShape;
     slotGrid     = new SlotItem[currentShape.Height, currentShape.Width];
     ResizePanel();
     CreateSlots();
     return(slotGrid);
 }
Esempio n. 2
0
    public void CreateShip(ShipScriptableObject ship)
    {
        foreach (Transform child in modulesHolder)
        {
            Destroy(child.gameObject);
        }

        slotGrid = shipBuilder.BuildShip(ship);
        gridSize = new int2(ship.Width, ship.Height);
    }
Esempio n. 3
0
    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));
    }