public void Produce(float time, Sprite image, ActionBarButton.ButtonType type) { producing = true; timeRemaining = time; totalTime = time; spriteRenderer.sprite = image; productionType = type; }
public void QueueItem(float productionTime, float baseCost, Sprite image, ActionBarButton.ButtonType buttonType) { ProductionSlot slot = getFirstEmptyProductionSlot(); if (slot && baseCost * slot.costMultiplier > gameControl.energy) { Debug.Log("ERROR! NOT ENOUGH ENERGY OR NOT ENOUGH SLOTS! ADD CODE HERE TO INFORM PLAYER!"); return; } if (buttonType == ActionBarButton.ButtonType.WhiteBloodCell) { gameControl.whiteBloodProduction++; } else if (buttonType == ActionBarButton.ButtonType.Platelet) { gameControl.plateletProduction++; } gameControl.energy -= baseCost * slot.costMultiplier; slot.Produce(productionTime, image, buttonType); }