Esempio n. 1
0
    private bool isRequirementMet(GameDataModel.Choice choice)
    {
        bool requirementMet = false;

        if (choice.requirement != null)
        {
            return(inventoryDataService.IsItemFound(choice.requirement));
        }
        return(requirementMet);
    }
Esempio n. 2
0
    public void TryCollectingOrb()
    {
        if (inventoryDataService.IsItemFound(itemRequired))
        {
            inventoryDataService.OrbFound(orbColor);
            this.gameObject.SetActive(false);
            gameMessage.GetComponent <Text>().text = "You've collected the " + orbColor + " orb.";

            if (inventoryDataService.HaveAllOrbsBeenFound())
            {
                gameState.EndGame();
            }
        }
        else
        {
            gameMessage.GetComponent <Text>().text = "You need a " + itemRequired
                                                     + " to collect the orb.";
        }
    }