The separation of the player inventory (what they are carrying) and how to display the inventory to the user is an example of a game design pattern (best practice approach) called Model-View-Controller (MVC), whereby we separate the code that updates the UI from the code that changes player and game variables, such as score and inventory item lists. Although this recipe has only one variable and one method to update the UI, well-structured game architectures scale up to cope with more complex games, so it is often worth the effort of using a little more code and an extra script class, even at this game's stage of development, if we want our final game architecture to be well structured and maintainable.
However, for very simple games, we may choose to display its status in a single script class. For an example of this approach for this recipe, remove the PlayerInventory and PlayerInventoryDisplay ...