Game Development Reference
In-Depth Information
In iOS, OnApplicationPause will be called whenever the application is minimized
or pushed into the background.
Do not rely on the OnApplicationPause event for creating your own
relative pause functionality. To achieve this, use the Time.timeScale
variable or code a more comprehensive system in which you have
selective control over which elements are paused.
Summary
This chapter focused on the manifold benefits available for your applications by
adopting an event-driven framework consistently through the EventManager
class. In implementing such a manager, we were able to rely on either interfaces
or delegates, and either method is powerful and extensible. Specifically, we saw
how it's easy to add more and more functionality into an Update function but how
doing this can lead to severe performance issues. Better is to analyze the connections
between your functionality to refactor it into an event-driven framework. Essentially,
events are the raw material of event-driven systems. They represent a necessary
connection between one action (the cause) and another (the response). To manage
events, we created the EventManager class—an integrated class or system that links
posters to listeners. It receives notifications from posters about events as and when
they happen and then immediately dispatches a function call to all listeners for the
event. In the next chapter, we'll examine cameras and rendering.
 
Search WWH ::




Custom Search