liveBook · Manning

Asset data

As explained in High Performance Unity Game Development

Asset data is game content and configuration data representing resources loaded or assigned for use by a game.

Asset data is the content and configuration a game uses, such as a Unity menu prefab and the UI elements that code needs to access. Separating that data from script logic reduces code complexity and avoids repeated handoffs when assets are missing or need changes. section 8.0 section 8.2.1

For menu assets, distinguish what stays fixed from what code must handle:

  • Static components, such as the game title, do not need to be exposed to code. section 8.0
  • Dynamic components, such as a button action or a changing gold or level string, need to be accessible to engineers. section 8.0
  • A GUIRef lets the prefab creator mark the components that need handling, so engineers can work with a prepared asset. section 8.2.1 section 8.9

Main menu

The “Survivor Game” title is static; the “Start” button is dynamic because it calls a function that code needs to assign. section 8.0

Figure 8.3 Our main menu has two UI components: the title and a button. The title is a static component because it does not change. As engineers, we don't care about the main menu title because we don't modify it in code. The 'Start' button, on the other hand, is a dynamic component. It calls one of our functions, and ideally, we want to set which function it calls in our script.

See the title and button distinguished by whether code needs to access them. section 8.0

How High Performance Unity Game Development covers it

How deep it goes
Defines static and dynamic menu components and describes GUIRef’s role, without detailing its implementation.
Examples
Contrasts a static game title with a dynamic Start button and changing gold or level strings.
What it assumes
Assumes work with Unity UI prefabs and menu scripts, while explaining the need to identify dynamic components.
What you can do after
Apply GUIRef to mark menu components that engineers need to access.
How it connects
Connects asset data to Unity prefabs, UI menus, GUIRef, metadata, and state machines.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of High Performance Unity Game Development. The section links point to the parts of the book it draws on.