Game Development Reference
In-Depth Information
Working with Mono
Unity supports two main scripting languages, namely, C# and JavaScript.
Developers should select one of these two from the outset and apply it consistently
throughout their project; this writes all scripts in the selected language. Failure to
do so (by mixing script files in different languages) typically causes unnecessary
headache and confusion. However, once you've settled on a language, such as C#,
it usually won't offer everything you need it to do to create games. C#, on its own,
can neither load and parse XML files to support save-game data, nor can it create
window objects and GUI widgets to perform advanced search and query behaviors
on complex data sets and collections. To achieve these additional behaviors and
lots more, we must turn to external libraries. Some libraries can be purchased
directly from the Unity's Asset Store, and these are typically used for a specific
and dedicated purpose. However, Unity ships with the Mono Framework, which
is a free, cross-platform, and open source implementation of the Microsoft .NET
Framework (a programming library), and it offers most classes available in this
library. The .NET Framework features classes to handle strings, file input-output,
search and sort data, keep track of dynamic lists, parse XML, and more. This means
that through Mono an extensive toolkit is open to you to effectively and efficiently
manage data in your application. This chapter explores some of the many ways in
which Mono can be deployed in a Unity application by considering lists, stacks,
Language Integrated Query ( Linq ), regular expressions, enumerators, and so on.
Search WWH ::




Custom Search