Пример #1
0
    public void WireUp(ShipComponent component, ShipComponentManager realShip)
    {
        var obj = Instantiate(component.prefab, pedestal);

        cost.text      = component.cost.ToString();
        partName.text  = component.name;
        this.component = component;
        this.realShip  = realShip;
        CookieTotal_ValueChanged();
        buyText.gameObject.SetActive(false);
    }
Пример #2
0
    // Start is called before the first frame update
    public void LoadStore(ShipComponentManager shipManager)
    {
        var part1 = components.items.Where(p => shipManager.CanEquip(p)).Random();

        partStages[0].WireUp(part1, shipManager);
        var part2 = components.items.Where(p => p != part1 && shipManager.CanEquip(p)).Random();

        partStages[1].WireUp(part2, shipManager);
        var part3 = components.items.Where(p => p != part1 && p != part2 && shipManager.CanEquip(p)).Random();

        partStages[2].WireUp(part3, shipManager);
        var part4 = components.items.Where(p => p != part1 && p != part2 && p != part3 && shipManager.CanEquip(p)).Random();

        partStages[3].WireUp(part4, shipManager);
    }