Unity Game Development Scripting
eBook - ePub

Unity Game Development Scripting

Kyle D'Aoust

Partager le livre
  1. 202 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Unity Game Development Scripting

Kyle D'Aoust

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

The intuitive and powerful Unity game engine is one of the most widely used and best loved packages for game development. Unity scripting is an essential but challenging skill to master in order to create custom game elements. Learning modular scripting allows you to rewrite as little code as possible as you deploy your scripts to multiple projects and work easier, quicker, and more efficiently than before.

In each chapter of this book, you'll learn how to script new game elements. Beginning with making custom controls for the keyboard and mouse, as well as the Xbox 360 Controller, you'll then get to grips with more complex systems such as inventory, data saving, and artificial intelligence. As you create these elements, you'll also learn how to make your scripts simpler and easy to use. This will allow drag-and-drop deployment, which is to be used by designers and nonprogrammers. Finally, you'll combine all of your newfound skills to create your own complete game project.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Unity Game Development Scripting est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Unity Game Development Scripting par Kyle D'Aoust en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Entreprise Applications. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2014
ISBN
9781783553631

Unity Game Development Scripting


Table of Contents

Unity Game Development Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Interactive Input
Picking the controls
Mapping the needed controls
Checking the input manager
Checking the Xbox 360 Controller inputs
Adding additional controller inputs
Adding a start button and trigger inputs
Adding directional pad inputs
Adding PC control inputs
Housing our control script
Creating and naming the script
Formatting the script
Creating the device detector
Adding the variables needed
Creating the detection function
Creating the identifier function
Let's get set and show them
Adding variables for each control
Adding a function to display the variables
Let's switch!
Creating control profiles
Adding a profile switching function
Adding the GUI interaction function
Customization is key
Swapping control schemes
Adding a control switch button to the GUI
Cycling control inputs
Adding the controls pop up to the GUI
Resetting the controls
Adding the Reset function
Adding the Reset input
Playtesting
Summary
2. GUI Time
A traditional 2D UI
Setting up our scene
Housing our 2D UI
Creating GUI buttons
Creating a health bar
Level counter
Creating an experience counter
Housing our 3D UI
Creating a 3D health bar
Creating 3D damage reports
The new Update function
Completing the damage reports
Creating 3D name tags
Summary
3. Expandable Item Classes
The self item class
Adding our variables
Buff or debuff stats
The health changer
The armor changer
The item activator
The melee item class
Adding our variables
Buff or debuff stats
The health changer
Let's interact with the environment
Detecting triggers
The projectile item class
Adding our variables
Buff or debuff stats
The health changer
Adding movement
Detecting triggers
Playtesting
Summary
4. Inventory
Features of an inventory
Limits of the inventory
Accessing the inventory
Organizing an inventory
Item count modifications
Item bartering
Dropping and picking up items
Destroying and using items
Displaying the inventory
Creating the inventory script
Creating and naming the script
Adding the necessary variables
Initializing our inventory
Creating the initializer
Adding items
Let's figure this out
Creating the adding function
Removing items
Let's figure this out
Creating the removing function
Setting the quick-select items
Setting the quick-select items quickly
Let's display the inventory
Using our custom inputs
Displaying the GUI
Running the GUI
Playtesting
Creating a test scene
Let's add an item
Let's remove some items
Other things to try out
Summary
5. Enemy and Friendly AIs
AI techniques
Finite state machines
The behavior tree form of the AI system
Combining the techniques
Let's start scripting!
Internal and external actions
External actions
Internal actions
Scripting the actions
Pathfinding
Creating paths using the waypoint system
Unity's NavMesh system
Setting up the environment
Creating the NavMesh
Adding our variables
Scripting the navigation functions
Character animations
Importing the model mesh
Scripting the animations
Putting it all together
Final coding touches
Filling out the inspector
Playtesting
Summary
6. Keeping Score
Prototype stats
Assigning the stats to the player
The stat tracker
Setting the stats
Resetting the stats
Resetting all of our prefs
Saving all of our prefs
Setting a specific pref
Resetting a specific pref
Showing our stats on the screen
The achievement system
Prototyping the achievements
Adding the required achievement variables
Resetting the achievements
Achievement trackers
Tracking the kills
Tracking the gold total
Tracking the gold spent
Tracking the player's level
Tracking the rounds won
Tracking the time played
Let's check the achievements
Checking a specific achievement
Checking all of the achievements
Displaying the achievements on screen
Adding the GUI functions
Playtesting
Summary
7. Creating Save and Load Systems
Saving data with flat files
Adding the required variables
Time to save our file
Deleting our flat files
Loading our flat files
Time to load our file
The XML save system
Creating our XML files
Saving data with XML
Adding the required variables
Saving the player data
Saving the enemy data
Loading data with XML
Loading the player data
Loading the enemy data
Creating the SaveHandler script
The checkpoint system
The save anywhere-anytime system
Playtesting
Summary
8. Aural Integration
Background music
Creating a random system
Adding a playlist system
Implementing the audio systems
Atmospheric sounds
Creating the script and variables
Initializing the variables
Playing the atmospheric sounds
Sound effects
Creating the script and variables
Playtesting
Summary
9. Game Settings
Figuring out what to optimize
Making video configurations
Setting the values
Toggling the shadows
Setting the field of view
Setting the resolution
Toggling the anti-aliasing property
Setting vsync
Changing the quality settings
Loading the settings
Making audio configurations
Setting the values
Configuring the volumes
Setting the speaker mode
Creating the settings menu
Preparing the code
Creating the GUI
Saving all the values
Loading all the values
Playtesting
Summary
10. Putting It All Together
Creating levels
The main menu
The playable level
Creating player interactions
Shooting and pausing
Collecting potions
Adding all the sounds
Playing the background music
Adding the atmospheric sounds
Implementing the GUI ...

Table des matiĂšres