O'Reilly logo

Unity iOS Essentials by Robert Wiebe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Separating dialogs from contents

We want to develop the dialog system, or core dialog functions, independently of the individual dialog content, so that the script code that manages the behavior of dialogs does not get mixed with the script code that presents and manages specific dialogs.

We need to consider the parts of the dialog that can be the same for every dialog versus the parts of the dialog specific to that dialog and find a way to separate the implementation.

The things that the dialog wrapper will implement are as follows:

  • Displaying the OK and Cancel buttons
  • Providing a hook to allow another script to manage the dialog content
  • Sending messages to other game objects, when the OK or Cancel button is pressed

The buttons

Our dialog wrapper assumes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required