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...
Mastering Unity Scripting
By :
Mastering Unity Scripting
By:
Overview of this book
Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Unity C# Refresher
Debugging
Singletons, Statics, GameObjects, and the World
Event-driven Programming
Cameras, Rendering, and Scenes
Working with Mono
Artificial Intelligence
Customizing the Unity Editor
Working with Textures, Models, and 2D
Source Control and Other Tips
Index
Customer Reviews