예제 #1
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.";
        }
    }