Book Image

Unity Game Development Scripting

By : Kyle D'Aoust
Book Image

Unity Game Development Scripting

By: Kyle D'Aoust

Overview of this book

Table of Contents (17 chapters)
Unity Game Development Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Index

A

  • achievements
    • prototyping / Prototyping the achievements
    • resetting / Resetting the achievements
    • checking for / Let's check the achievements
    • specific achievement, checking / Checking a specific achievement
    • all achievements, checking / Checking all of the achievements
  • achievements onscreen
    • displaying / Displaying the achievements on screen
    • GUI functions, adding / Adding the GUI functions
  • achievement system
    • about / The achievement system
    • achievements, prototyping / Prototyping the achievements
    • achievement variables, adding / Adding the required achievement variables
    • achievements, resetting / Resetting the achievements
  • achievement trackers
    • about / Achievement trackers
    • player kills, tracking / Tracking the kills
    • gold total, tracking / Tracking the gold total
    • gold spent, tracking / Tracking the gold spent
    • player's level, tracking / Tracking the player's level
    • rounds won, tracking / Tracking the rounds won
    • time played, tracking / Tracking the time played
  • achievement variables
    • adding / Adding the required achievement variables
  • actions
    • scripting / Scripting the actions
  • Active state / Finite state machines
  • adding function
    • creating / Creating the adding function
  • Advanced options / Creating the NavMesh
  • AI
    • techniques / AI techniques
    • external actions / External actions
    • affecting / Affecting the AI
  • AI package
    • wrapping up / Putting it all together
    • final coding touches / Final coding touches
    • inspector, filling out / Filling out the inspector
  • AI techniques
    • about / AI techniques
    • finite state machines / Finite state machines
    • behavior tree form, of AI system / The behavior tree form of the AI system
  • all achievements
    • checking / Checking all of the achievements
  • Ambient Sample Pack
    • URL / Playtesting
  • animations
    • scripting / Scripting the animations
  • anti-aliasing property
    • toggling / Toggling the anti-aliasing property
  • armor changer, self item class / The armor changer
  • atmospheric sounds
    • about / Atmospheric sounds
    • script, creating / Creating the script and variables
    • variables, creating / Creating the script and variables
    • variables, initializing / Initializing the variables
    • playing / Playing the atmospheric sounds
    • adding / Adding the atmospheric sounds
  • audio configurations
    • creating / Making audio configurations
    • values, setting / Setting the values
    • volumes, configuring / Configuring the volumes
    • speaker mode, setting / Setting the speaker mode
  • audio systems
    • implementing / Implementing the audio systems

B

  • background music
    • about / Background music
    • random system, creating / Creating a random system
    • playlist system, adding / Adding a playlist system
    • audio systems, implementing / Implementing the audio systems
    • playing / Playing the background music
  • Baldur's Gate 2 / Limits of the inventory
  • BeginHorizontal function / Running the GUI
  • behavior tree / Finite state machines
  • behavior tree form, of AI system
    • about / The behavior tree form of the AI system
    • techniques, combining / Combining the techniques
    • scripting / Let's start scripting!
  • bool variable / Creating 3D damage reports, Showing our stats on the screen, Adding the required achievement variables, Setting the resolution
  • Borderlands / Limits of the inventory

C

  • character animations
    • about / Character animations
    • model mesh, importing / Importing the model mesh
    • animations, scripting / Scripting the animations
  • CheckAllAchievements function / Checking all of the achievements
  • checkpoint system / The checkpoint system
  • code, settings menu
    • preparing / Preparing the code
  • Color variable / Creating 3D damage reports
  • Combat function / Scripting the actions
  • controller inputs
    • adding / Adding additional controller inputs
  • controls
    • about / Picking the controls
    • mapping / Mapping the needed controls
    • input manager, checking / Checking the input manager
    • Xbox 360 Controller inputs, checking / Checking the Xbox 360 Controller inputs
    • additional controller inputs, adding / Adding additional controller inputs
    • start button, adding / Adding a start button and trigger inputs
    • trigger inputs, adding / Adding a start button and trigger inputs
    • directional pad inputs, adding / Adding directional pad inputs
    • PC control inputs, adding / Adding PC control inputs
    • customizing / Customization is key
  • control script
    • setting up / Housing our control script, Let's get set and show them
    • creating / Creating and naming the script
    • naming / Creating and naming the script
    • formatting / Formatting the script
    • variables, adding for each control / Adding variables for each control
    • function, adding for displaying variables / Adding a function to display the variables
  • Convert function / Setting the resolution
  • CurrentBarLength / Creating a 3D health bar
  • custom inputs
    • using / Using our custom inputs
  • customization, controls
    • about / Customization is key
    • control schemes, swapping / Swapping control schemes
    • control switch button, adding to GUI / Adding a control switch button to the GUI
    • control inputs, cycling / Cycling control inputs
    • controls pop up, adding to GUI / Adding the controls pop up to the GUI
    • controls, resetting / Resetting the controls
    • reset function, adding / Adding the Reset function
    • Reset input, adding / Adding the Reset input

D

  • 2D UI
    • about / A traditional 2D UI
    • scene, setting up / Setting up our scene
    • housing / Housing our 2D UI
    • GUI buttons, creating / Creating GUI buttons
    • health bar, creating / Creating a health bar
    • level counter / Level counter
    • experience counter, creating / Creating an experience counter
  • 3D damage reports
    • creating / Creating 3D damage reports
  • 3D health bar
    • creating / Creating a 3D health bar
  • 3D name tags
    • creating / Creating 3D name tags
  • 3D UI
    • housing / Housing our 3D UI
    • 3D health bar, creating / Creating a 3D health bar
    • 3D damage reports, creating / Creating 3D damage reports
    • new Update function / The new Update function
    • damage reports, completing / Completing the damage reports
    • 3D name tags, creating / Creating 3D name tags
  • damage reports
    • completing / Completing the damage reports
  • Damage variable / Creating 3D damage reports
  • data
    • saving / Saving and loading
    • loading / Saving and loading
    • script, adding / Adding the script
  • Delete function / Deleting our flat files
  • DetectController function / Creating the detection function
  • device detector
    • creating / Creating the device detector
    • variables, adding / Adding the variables needed
    • detection function, creating / Creating the detection function
    • identifier function, creating / Creating the identifier function
  • directional pad inputs
    • adding / Adding directional pad inputs

E

  • enemy data, XML
    • saving / Saving the enemy data
    • loading / Loading the enemy data
  • enemy stats
    • affecting / Buff or debuff stats
    • health changer / The health changer
    • movement, adding / Adding movement
    • triggers, detecting / Detecting triggers
  • enum
    • about / Creating control profiles
  • environment
    • setting up / Setting up the environment
  • environment, melee item class
    • interacting with / Let's interact with the environment
  • environment, setting up
    • NavMesh, creating / Creating the NavMesh
    • variables, adding / Adding our variables
    • navigation functions, scripting / Scripting the navigation functions
  • experience counter
    • creating / Creating an experience counter
  • external actions
    • about / External actions

F

  • field of view
    • setting / Setting the field of view
  • final coding touches / Final coding touches
  • final preparations, game
    • win conditions, adding / Adding win conditions
    • AI, affecting / Affecting the AI
    • items, finalizing / Finalizing the items
    • levels, creating / Creating more levels
  • finite state machines / Finite state machines
  • First Person Controller / The playable level
  • flat files
    • saving with / Saving data with flat files
    • required variables, adding / Adding the required variables
    • saving / Time to save our file
    • deleting / Deleting our flat files
    • loading with / Loading our flat files
    • loading / Time to load our file
  • Footsteps Sounds Carpet Pack
    • URL / Playtesting
  • Future Weapons Set
    • URL / Playtesting

G

  • game
    • pausing / Shooting and pausing
    • shooting / Shooting and pausing
    • potions, collecting / Collecting potions
  • game settings
    • optimization, figuring / Figuring out what to optimize
  • GetJoystickNames function
    • about / Creating the detection function
  • gold spent
    • tracking / Tracking the gold spent
  • gold total
    • tracking / Tracking the gold total
  • Guard function / Scripting the actions
  • GUI
    • displaying / Displaying the GUI
    • running / Running the GUI
    • creating / Creating the GUI
    • implementing / Implementing the GUI
    • _2D script, adding / Adding the script
    • StatTracker script, adding / Adding the script
  • GUI buttons
    • creating / Creating GUI buttons
  • GUI functions
    • adding / Adding the GUI functions
  • GUIStyle variable / Level counter
  • GUI_2D script
    • adding / Adding the script
    • stats, tracking / Tracking stats

H

  • health bar
    • creating / Creating a health bar
  • health changer, melee item class / The health changer
  • health changer, projectile item class / The health changer
  • health changer, self item class / The health changer

I

  • identifier function
    • creating / Creating the identifier function
  • initializer
    • creating / Creating the initializer
  • InnerText property / Saving the player data
  • Input.GetJoystickNames() / Creating the detection function
  • input manager
    • checking / Checking the input manager
  • inspector
    • filling out / Filling out the inspector
  • internal actions
    • about / Internal actions
  • int variable / Creating the adding function, Creating the removing function
  • inventory
    • features / Features of an inventory
    • limits / Limits of the inventory
    • accessing / Accessing the inventory
    • organizing / Organizing an inventory
    • displaying / Displaying the inventory, Let's display the inventory
    • items, adding to / Let's figure this out
    • items, removing from / Creating the removing function
    • testing / Other things to try out
  • inventory script
    • creating / Creating the inventory script, Creating and naming the script
    • naming / Creating and naming the script
    • necessary variables, adding / Adding the necessary variables
    • initializing / Initializing our inventory
    • initializer, creating / Creating the initializer
  • isControllerConnected variable
    • using / Adding variables for each control
  • item
    • adding / Let's add an item
  • item activator, self item class / The item activator
  • item bartering / Item bartering
  • item count modifications
    • item bartering / Item bartering
    • items, dropping / Dropping and picking up items
    • items, picking / Dropping and picking up items
    • items, destroying / Destroying and using items
    • items, using / Destroying and using items
  • items
    • dropping / Dropping and picking up items
    • picking / Dropping and picking up items
    • destroying / Destroying and using items
    • using / Destroying and using items
    • adding / Adding items
    • adding, to inventory / Let's figure this out
    • adding function, creating / Creating the adding function
    • removing / Removing items, Let's remove some items
    • removing, from inventory / Let's figure this out
    • removing function, creating / Creating the removing function
    • finalizing / Finalizing the items

L

  • level counter / Level counter
  • levels
    • creating / Creating levels, Creating more levels
    • main menu / The main menu
    • playable level / The playable level
  • LoadEnemies function / The save anywhere-anytime system

M

  • main menu, levels / The main menu
  • Massive Multiplayer Online / Accessing the inventory
  • melee item class
    • about / The melee item class
    • variables, adding / Adding our variables
    • player stats, modifying / Buff or debuff stats
  • MeleeType enum
    • about / Adding our variables
  • model mesh
    • importing / Importing the model mesh
  • movement, projectile item class
    • adding / Adding movement

N

  • navigation functions
    • scripting / Scripting the navigation functions
  • NavMesh
    • creating / Creating the NavMesh
  • NavMeshAgent object / Adding our variables
  • necessary variables
    • adding / Adding the necessary variables
  • Notepad++
    • URL / Creating our XML files

O

  • Off state / Finite state machines
  • OnGUI function
    • about / Adding a function to display the variables
    / Showing our stats on the screen, Adding the GUI functions
  • On state / Finite state machines

P

  • pathfinding
    • about / Pathfinding
    • paths creating, waypoint system used / Creating paths using the waypoint system
    • Unity's NavMesh system / Unity's NavMesh system
    • environment, setting up / Setting up the environment
  • paths
    • creating, waypoint system used / Creating paths using the waypoint system
  • PC and Xbox 360 Controller controls, switching
    • about / Let's switch!
    • control profiles, creating / Creating control profiles
    • profile switching function, adding / Adding a profile switching function
    • GUI interaction function, adding / Adding the GUI interaction function
  • PC control inputs
    • adding / Adding PC control inputs
  • pitch property / Implementing the audio systems
  • playable level / The playable level
  • player
    • prototype stats, assigning to / Assigning the stats to the player
  • player's level
    • tracking / Tracking the player's level
  • player data, XML
    • saving / Saving the player data
    • loading / Loading the player data
  • player interactions
    • creating / Creating player interactions
    • game, shooting / Shooting and pausing
    • game, pausing / Shooting and pausing
  • player kills
    • tracking / Tracking the kills
  • PlayerPrefs function / Saving all the values
  • player stats
    • adding / Buff or debuff stats
    • subtracting / Buff or debuff stats
  • player stats, melee item class
    • health changer / The health changer
    • environment, interacting with / Let's interact with the environment
    • triggers, detecting / Detecting triggers
  • player stats, self item class
    • health changer / The health changer
    • armor changer / The armor changer
    • item activator / The item activator
  • Play function / Scripting the animations, Adding a playlist system
  • playlist system
    • adding / Adding a playlist system
  • playtest
    • about / Playtesting, Playtesting
  • playtest, stats
    • about / Playtesting
  • playtest, steps
    • about / Creating 3D name tags
  • playtest, test scene
    • about / Playtesting
  • playtesting
    • about / Playtesting, Playtesting, Playtesting, Playtesting
    • test scene, creating / Creating a test scene
    • item, adding / Let's add an item
    • items, removing / Let's remove some items
  • playtesting, item classes
    • about / Playtesting
  • potions
    • collecting / Collecting potions
  • prefs
    • resetting / Resetting all of our prefs
    • saving / Saving all of our prefs
  • projectile item class
    • about / The projectile item class
    • variables, adding / Adding our variables
    • enemy stats, affecting / Buff or debuff stats
  • prototype stats
    • about / Prototype stats
    • assigning, to player / Assigning the stats to the player

Q

  • quality settings
    • changing / Changing the quality settings
  • quick-select items
    • setting / Setting the quick-select items
    • setting, quickly / Setting the quick-select items quickly
    • inventory, displaying / Let's display the inventory
    • custom inputs, using / Using our custom inputs
    • GUI, displaying / Displaying the GUI
    • GUI, running / Running the GUI

R

  • Radius property / Creating the NavMesh
  • random system
    • creating / Creating a random system
  • Rectangle variable / Adding the necessary variables
  • RemoveAll function / Saving the enemy data
  • required variables, flat files
    • adding / Adding the required variables
  • required variables, XML
    • adding / Adding the required variables
  • resolution
    • setting / Setting the resolution
  • rounds won
    • tracking / Tracking the rounds won

S

  • save anywhere-anytime system / The save anywhere-anytime system
  • SaveEnemies function / The save anywhere-anytime system
  • SaveHandler script
    • creating / Creating the SaveHandler script
    • checkpoint system / The checkpoint system
    • save anywhere-anytime system / The save anywhere-anytime system
  • scene
    • setting up / Setting up our scene
  • Scene filter / Creating the NavMesh
  • screen
    • stats, displaying on / Showing our stats on the screen
  • script
    • adding / Adding the script
  • script, atmospheric sounds
    • creating / Creating the script and variables
  • script, sound effects
    • creating / Creating the script and variables
  • scripting / Let's start scripting!
  • self item class
    • about / The self item class
    • variables, adding / Adding our variables
    • player stats, adding / Buff or debuff stats
    • player stats, subtracting / Buff or debuff stats
  • SetDefaultValues() function
    • about / Swapping control schemes
  • SetNewKey function
    • about / Adding the controls pop up to the GUI
  • settings, video configurations
    • loading / Loading the settings
  • settings menu
    • creating / Creating the settings menu
    • code, preparing / Preparing the code
    • GUI, creating / Creating the GUI
    • values, saving / Saving all the values
    • values, loading / Loading all the values
  • shadows
    • toggling / Toggling the shadows
  • sound effects
    • about / Sound effects
    • script, creating / Creating the script and variables
    • variables, creating / Creating the script and variables
  • sounds
    • adding / Adding all the sounds
    • background music, playing / Playing the background music
    • atmospheric sounds, adding / Adding the atmospheric sounds
  • SpawnTime / The new Update function
  • speaker mode
    • setting / Setting the speaker mode
  • specific achievement
    • checking / Checking a specific achievement
  • specific pref
    • setting / Setting a specific pref
    • resetting / Resetting a specific pref
  • Speed variable
    • about / Adding movement
  • Start() function / Creating a 3D health bar
  • start button
    • adding / Adding a start button and trigger inputs
  • Start function / Adding win conditions
  • stats
    • setting / Setting the stats
    • resetting / Resetting the stats
    • displaying, on screen / Showing our stats on the screen
    • tracking / Tracking stats
  • stat tracker
    • about / The stat tracker
    • stats, setting / Setting the stats
    • stats, resetting / Resetting the stats
    • prefs, resetting / Resetting all of our prefs
    • prefs, saving / Saving all of our prefs
    • specific pref, setting / Setting a specific pref
    • specific pref, resetting / Resetting a specific pref
    • stats, displaying on screen / Showing our stats on the screen
  • StatTracker script
    • adding / Adding the script
  • Step Height property / Creating the NavMesh
  • StreamReader
    • about / Time to load our file
  • StreamWriter
    • about / Time to save our file
  • SwitchControlScheme() function
    • about / Swapping control schemes

T

  • techniques
    • combining / Combining the techniques
  • test scene
    • creating / Creating a test scene
  • TextMesh object / Creating 3D damage reports
  • The Combat Collection Starter Edition
    • URL / Playtesting
  • The Elder Scrolls V$ Skyrim / Limits of the inventory, Displaying the inventory
  • The Fantasy Music Collection (Starter)
    • URL / Playtesting
  • time played
    • tracking / Tracking the time played
  • Transform variable / Creating a 3D health bar
  • trigger inputs
    • adding / Adding a start button and trigger inputs
  • triggers, melee item class
    • detecting / Detecting triggers
  • triggers, projectile item class
    • detecting / Detecting triggers
  • txtColor variable / Creating 3D damage reports

U

  • Unity's NavMesh system / Unity's NavMesh system
  • Update function
    • about / The new Update function, Adding movement, Using our custom inputs
    / Playtesting, Implementing the audio systems, Adding win conditions
  • using statement / Adding the necessary variables, Creating a random system

V

  • values, audio configurations
    • setting / Setting the values
  • values, settings menu
    • saving / Saving all the values
    • loading / Loading all the values
  • values, video configurations
    • setting / Setting the values
  • variables
    • adding / Adding our variables
    • initializing / Initializing the variables
  • variables, atmospheric sounds
    • creating / Creating the script and variables
  • variables, melee item class
    • adding / Adding our variables
  • variables, projectile item class
    • adding / Adding our variables
  • variables, self item class
    • adding / Adding our variables
  • variables, sound effects
    • creating / Creating the script and variables
  • Vector3 variable / Creating a 3D health bar
  • video configurations
    • creating / Making video configurations
    • values, setting / Setting the values
    • shadows, toggling / Toggling the shadows
    • field of view, setting / Setting the field of view
    • resolution, setting / Setting the resolution
    • anti-aliasing property, toggling / Toggling the anti-aliasing property
    • vsync, setting / Setting vsync
    • quality settings, changing / Changing the quality settings
    • settings, loading / Loading the settings
  • volumes
    • configuring / Configuring the volumes
  • vsync
    • setting / Setting vsync

W

  • waypoint system
    • used, for creating paths / Creating paths using the waypoint system
  • win conditions
    • adding / Adding win conditions
  • World of Warcraft / Accessing the inventory

X

  • Xbox 360 Controller
    • inputs, checking / Checking the Xbox 360 Controller inputs
  • XML
    • saving with / Saving data with XML
    • required variables, adding / Adding the required variables
    • player data, saving / Saving the player data
    • enemy data, saving / Saving the enemy data
    • loading with / Loading data with XML
    • player data, loading / Loading the player data
    • enemy data, loading / Loading the enemy data
  • XML files
    • creating / Creating our XML files
  • XML save system
    • about / The XML save system
    • XML files, creating / Creating our XML files