Ejemplo n.º 1
0
    public void UpdateSubmitButton()
    {
        JobHandler.ItemAmountSuitable itemAmountChecked;
        JobHandler.ItemTypeSuitable   itemTypeChecked;

        if (InventoryItemSlot.childCount == 0)
        {
            SubmitButton.GetComponent <Button>().interactable = false;
        }
        else
        {
            itemAmountChecked = job.CheckItemAmoundSuitable(InventoryItemSlot.GetChild(0).gameObject.GetComponent <InventoryItemHandler>());
            itemTypeChecked   = job.CheckItemTypeSuitable(InventoryItemSlot.GetChild(0).gameObject.GetComponent <InventoryItemHandler>());

            if (itemAmountChecked != JobHandler.ItemAmountSuitable.TOO_LITTLE)
            {
                switch (itemTypeChecked)
                {
                case JobHandler.ItemTypeSuitable.CORRECT_EFFECT_WITHOUT_UNWANTED_HARMFUL_SIDEFFECTS:
                    SubmitButton.GetComponent <Button>().interactable = true;

                    break;

                case JobHandler.ItemTypeSuitable.CORRECT_EFFECT_WITH_UNWANTED_HARMFUL_SIDEFFECTS:
                    SubmitButton.GetComponent <Button>().interactable = true;

                    break;

                case JobHandler.ItemTypeSuitable.WRONG_EFFECT:

                    SubmitButton.GetComponent <Button>().interactable = true;

                    break;

                case JobHandler.ItemTypeSuitable.CORRECT_INVENTORYITEM:

                    SubmitButton.GetComponent <Button>().interactable = true;

                    break;

                case JobHandler.ItemTypeSuitable.WRONG_INVENTORYITEM:

                    SubmitButton.GetComponent <Button>().interactable = false;

                    break;
                }
            }
            else
            {
                SubmitButton.GetComponent <Button>().interactable = false;
            }
        }
    }