Index
A
- access modifiers
- using, for variables / Using access modifiers for variables and methods
- using, for methods / Using access modifiers for variables and methods
- active State
- changing / Changing the active State and controlling the Scene
- game Scene, pausing / Pausing the game Scene
- activeState variable / Setting up the StateManager controller
- AddTwoNumbers() method / Method names are substitutes too, What just happened?, Time for action – returning a value from AddTwoNumbers()
- Application Programming Interface (API)
- about / Introducing the C# interface
- Awake() method
- adding, to StateManager / Time for action – adding the Awake method to StateManager, What just happened?
B
- BeginState
- BeginState() method / What just happened?
- BeginState class
- instantiating / Time for action – instantiating the BeginState class, What just happened?
- benefits, State Machine
- built-in variable types
- about / The most common built-in variable types
- values, assigning / Time for action – assigning values while declaring the variable , What just happened?
C
- C#
- choosing / Choosing to use C# instead of UnityScript, Reason 3 for choosing C# – coding rules are specific
- choosing, reasons / Reason 1 for choosing C# – vast amount of documentation on the Internet, Reason 2 for choosing C# – flexibility to use Unity scripts and regular C# code files, Reason 3 for choosing C# – coding rules are specific
- summarizing / Pulling all the little C# pieces together
- website / Visit my favorite website for C#
- C# interface
- about / Introducing the C# interface
- C# objects
- C# programming surface
- scratching / Scratching the surface of C# programming
- C# features / Looking at even more C# features
- Unity features / Looking at even more Unity features
- C# script files
- writing / Working with C# script files
- creating / Time for action – create a C# script file, What just happened?
- MonoDevelop code editor / Introducing the MonoDevelop code editor
- syncing, between MonoDevelop and Unity / Syncing C# files between MonoDevelop and Unity
- LearningScript in MonoDevelop, opening / Time for action – opening LearningScript in MonoDevelop
- sync, fixing / Fixing sync if it isn't working properly
- C# statements
- writing / Writing C# statements properly
- cameras
- adding, for different viewing options / Adding cameras for different viewing options, Time for action – setting up two additional cameras in the scene, What just happened?
- scripts, attaching to / Attaching scripts to the new cameras, What just happened?
- class
- instantiating / Instantiate a class to create an object
- creating / Time for action – creating a script and a class, What just happened?
- class, instantiating
- script, creating / Time for action – creating a script and a class, What just happened?
- class, creating / Time for action – creating a script and a class, What just happened?
- file location, specifying with namespace declaration / Specifying a file's location with a namespace declaration
- code files, locating with using statement / Locating code files with a using statement
- classes
- about / Introducing the class
- code block / Variable scope – determining where a variable can be used
- code files
- locating, with using statement / Locating code files with a using statement
- coding skills
- applying, to State Machine / Applying your new coding skills to a State Machine
- Collection Initializer
- used, for items adding to List / Using a Collection Initializer to add items to a List or Dictionary, What just happened?
- completed game
- visualizing / Visualizing the completed game
- component objects
- creating / Unity creates Components behind the scenes
- component properties, Unity Inspector
- variables, converting to / Variables become Component properties
- script name, changing / Unity changes script and variable names slightly
- property value, changing / Changing a property's value in the Inspector panel
- components / Teaching behaviors to GameObjects
- curly braces
- used, for method definition ending / Ending a method definition using curly braces
D
- Debug / Setup the State Machine and add a Player GameObject
- dots
- simplifying, in Dot Syntax / Simplifying the dots in Dot Syntax
- Dot Syntax
- using / Using Dot Syntax is like addressing a letter
- dots, simplifying / Simplifying the dots in Dot Syntax
- using, in script / Using Dot Syntax in a script
- dot syntax
- components, communicating / Components communicating using the Dot Syntax
- Dot Syntax, in script
- variables, accessing of components / Accessing a Component's own variables and methods, Time for action – accessing a variable in the current Component, What just happened?
- methods, accessing of components / Accessing a Component's own variables and methods
- component, accessing on current GameObject / Accessing another Component on the current GameObject, Time for action – communicating with another Component on the Main Camera, What just happened?
- code analysis / What just happened?, What just happened?, On LearningScript:
- GameObjects, accessing / Accessing other GameObjects and their Components
- drag-and-drop
- used, for assigning GameObjects / Time for action – trying drag-and-drop to assign a GameObject, What just happened?
E
- EnergyPulse Prefab
- EnergyPulses
- firing / The EnergyPulse is fired
- objects, controlling / Controlling EnergyPulse objects
F
- file location
- specifying, with namespace declaration / Specifying a file's location with a namespace declaration
- FireEnergyPulse() method / Shooting rapid-fire EnergyPulses
- FollowingPlayer camera script
- foreach loop
- used, for data retrieving / Time for action – using foreach loops to retrieve data, What just happened?
- for loop
- using / Using the for loop
- used, for pony selection / Time for action – selecting a pony from a List using a for loop, What just happened?
- FPS / The Update method is called over and over and over…
G
- game
- winning score / Scoring for the win
- losing score / Losing when Player crashes
- game control
- delegating, to state / Delegating game control to a State
- game controlling
- State Machine, using / Using a State Machine is a design pattern choice
- GameData script
- images as textures / Understanding images as textures in Unity
- splash screens, using between game levels / Using splash screens between game levels
- splash screens, displaying / Displaying the splash screens, Have a go hero – adjusting the button size and placement
- GameObject
- assigning, drag-and-drop used / Time for action – trying drag-and-drop to assign a GameObject, What just happened?
- GameObject.Find() method / Time for action – setting up two additional cameras in the scene
- GameObjects
- game Scene
- pausing / Time for action – adding code to pause the game Scene, What just happened?
- changing, timer used / Changing the State using a timer
- game score
- initializing, code / Keeping score during the game
- scoring system, initializing / Initializing the scoring system
- in Scene1 play State / Keeping score in the Scene1 play State
I
- if-else statement
- using, for alternate code execution / Using an if-else statement to execute alternate code
- else, adding to / Time for action – add "else" to the if statement, What just happened?
- if statement
- about / Testing conditions with an if statement
- testing conditions / Testing conditions with an if statement
- creating / Time for action – create a couple of if statements, What just happened?
- creating, with multiple condition check / Time for action – create if statements with more than one condition to check, What just happened?
- Inspector pane / By using a little Unity magic, a script becomes a Component
- Inspector panel
- about / Changing a property's value in the Inspector panel
- public variables, displaying / Displaying public variables in the Inspector panel, What just happened?
- Instantiate() method / The EnergyPulse is fired
- instantiate keyword / Instantiate a class to create an object
- interface guarantee, State Machine / The State Machine and the interface guarantee
- IStateBase interface
- entering / Enter the IStateBase interface again
- features / Enter the IStateBase interface again
- StateManager, modifying / Time for action – modify StateManager, What just happened?
- code flow / What just happened?
- code flow, summarizing / Summarizing the code flow
- items
- accessing, in list / Storing data in an array, a List, or a Dictionary
- storing, in array / Storing items in an array
- storing, in List / Storing items in a List
- storing, in dictionary / Storing items in a Dictionary
- adding, Collection Initializer used / Using a Collection Initializer to add items to a List or Dictionary
- items, storing in dictionary
- pony name dictionary, creating / Time for action – create a dictionary of pony names and keys, What just happened?
- items, storing in List
- pony name list, creating / Time for action – create a List of pony names, What just happened?, Have a go hero – add another pony to the List
K
L
- LearningScript variables / Declaring a variable and its type
- Lerp / Easing into Unity's scripting documentation
- List
- looping through / Looping though lists to make decisions
- Lives option
- setting, for Player GameObject / Time for action – setting the Lives for Player, What just happened?, Have a go hero – changing the setup spin speed
- LookAT() method / What just happened?
- LostState class / Verifying the code of your classes
- LostStates class / Setup the State Machine and add a Player GameObject
M
- method definition
- parameters, specifying / Specifying a method's parameters
- parameters, counting / How many parameters can a method have?
- method names / Begin method names with an uppercase letter
- methods
- about / Using the term method instead of function
- using, in script / Using a method in a script
- working / Time for action – learning how a method works
- in script file / What's in this script file?
- substitute / Method names are substitutes too, What just happened?
- naming / Naming methods properly
- begin method names / Begin method names with an uppercase letter
- multi-word names, using / Using multi-word names for a method
- parenthesis, using / Parentheses are part of the method name
- defining / Defining a method properly
- declaring / Defining a method properly
- defining, minimum requirements / The minimum requirements for defining a method, Understanding parentheses – why are they there?, Time for action – adding code between the parentheses, What just happened?
- calling / Calling a method
- arguments, using in parenthesis / Using arguments in the parentheses of a method
- value, returning / Returning a value from a method
- MonoBehaviour class / Following the State Machine logic flow
- MonoBehaviour method / Using Unity's Update and Start methods
- MonoDevelop code editor / Introducing the MonoDevelop code editor
N
- namespace declaration
- file location, specifying with / Specifying a file's location with a namespace declaration
O
- Object-Oriented Programming / Using the term method instead of function
- objects
- working with / Working with objects is a class act
- OnGUI() method
- adding, to StateManager / Adding OnGUI to the StateManager class
- adding, to StateManager controller / Adding OnGUI to the StateManager class
- about / What just happened?
- OOP / Using the term method instead of function
P
- PickedColor() method / What just happened?
- playable scene
- switching to / Switching to the first play State and playable scene
- Play button / A more technical look at the magic
- Player
- moving, Rigidbody physics used / Moving the Player using Rigidbody physics, What just happened?
- Player Collider
- Player Color option
- color modification, GUI buttons used / Time for action – changing the color using GUI buttons, What just happened?, Adding the Lives option for Player
- Player GameObject
- adding / Add a Player GameObject, Time for action - adding a Player GameObject
- controlling / Controlling the Player GameObject
- rotating, in SetupState / Time for action – rotating Player in SetupState, What just happened?
- Player Color option, adding / Adding the Player Color option, Time for action – changing the color using GUI buttons, What just happened?
- Lives option, adding / Adding the Lives option for Player
- play State
- switching to / Switching to the first play State and playable scene
- PlayStates class / Setup the State Machine and add a Player GameObject
- PlayState to add another State
- prefab / Time for action – creating a good and bad prefab
R
- rapid-fire EnergyPulses
- shooting / Shooting rapid-fire EnergyPulses
- reference manual documentation, transform component
- ResetPlayer() method / Losing the game in Scene1
- Return/Enter key / What just happened?, What just happened?
- Rigidbody physics
- used, for Player moving / Moving the Player using Rigidbody physics, What just happened?
- Rotate() method / What just happened?
S
- Scene
- controlling / Changing the active State and controlling the Scene
- GameObjects, adding / Time for action – adding GameObjects and a button to the Scene, What just happened?
- button, adding / Time for action – adding GameObjects and a button to the Scene, What just happened?
- Scene1 play State
- score, keeping / Keeping score in the Scene1 play State
- game, losing / Losing the game in Scene1
- losing strategy / Losing the game in Scene1
- winning strategy / Losing the game in Scene1, Determining how to win or lose
- game level, winning / Winning the level in Scene1
- level, winning / Winning the level in Scene1
- prefabs, creating / Time for action – creating a good and bad prefab
- Scene1, Player
- loading / Loading Scene1 using code
- Scenes
- about / Changing Scenes
- another Scene, setting up / Time for action – setting up another Scene, What just happened?
- changing, side effect / Changing Scenes destroys the existing GameObjects
- GameManager, inserting between / Keeping GameManager between scenes
- Awake() method, adding to StateManager / Time for action – adding the Awake method to StateManager, What just happened?
- changing / Changing the Scenes
- changing,by code additions / What just happened?
- class code, verifying / Verifying the code of your classes
- Scenes and States diagram / Setup the State Machine and add a Player GameObject
- screenDuration variable / What just happened?
- script
- variable, actions / Understanding what a variable does in a script
- variable, naming / Naming a variable
- variable name, as value substitute / A variable name is just a substitute for a value
- creating variable, working / Time for action – creating a variable and seeing how it works, What just happened?
- number, modifying to different number / Time for action – changing the number 9 to a different number, What just happened?
- methods, using / Using methods in a script
- about / Working with objects is a class act
- Dot Syntax, using in / Using Dot Syntax in a script
- creating / Time for action – creating a script and a class, What just happened?
- scripting documentation, Unity
- about / Easing into Unity's scripting documentation
- Unity Reference Manual, reading / Reading the Unity Reference Manual first
- Unity Reference Manual, code examples / Finding code examples in the Scripting Reference as needed
- Scripting Reference / Maneuvering around Unity's documentation, Introducing the C# interface
- scripting reference documentation, transform component
- scriptphobia
- dealing with / Dealing with scriptphobia
- GameObjects, behaviors / Teaching behaviors to GameObjects
- scripts, attaching to cameras
- LookAtPlayer camera script / Time for actioning – attach the LookAtPlayer camera script, What just happened?
- FollowingPlayer camera script / Time for action – attaching the FollowingPlayer camera script, What just happened?
- SetPlayer() method / Initializing the scoring system
- SetupState class / Setup the State Machine and add a Player GameObject
- ShowIt() method / What just happened?
- single-shoot EnergyPulse
- shooting / Shooting a single-shot EnergyPulse
- Start() method / The Start method is called one time
- state
- game control, delegating to / Delegating game control to a State
- State classes
- about / Creating four State classes
- BeginState, modifying / Time for action – modifying BeginState and add three more States, What just happened?
- StateFixedUpdate() method / Have a go hero – adding another method to the interface
- State Machine
- coding skills, applying to / Applying your new coding skills to a State Machine
- about / Understanding the concepts of a State Machine
- benefits / Benefits of by using a State Machine
- Unity project, controlling / Benefits of by using a State Machine
- interface guarantee / The State Machine and the interface guarantee
- interface, implementing / Time for action – implementing an interface, What just happened?
- setting up / Setup the State Machine and add a Player GameObject
- setting up, in Unity / In Unity
- setting up, in MonoDevelop / In MonoDevelop, What just happened?
- game data, storing / Storing game data in its own script
- GameData script, creating / Time for action – creating a GameData script
- used, for game controlling / Controlling the game with a State Machine
- using, at GameObject level / Using the State Machine at the GameObject level
- State Machine logic flow
- about / Following the State Machine logic flow
- game control, delegating to state / Delegating game control to a State
- state, switching / Switching to another State when called to do so
- active state, tracking / Keeping track of the active State
- StateManager
- Restart() method / Calling the Restart method of the StateManager
- StateManager class / Verifying the code of your classes
- StateManager controller
- setting up / Setting up the StateManager controller
- inheritance example / Studying an example of inheritance
- IStateBase interface, entering / Enter the IStateBase interface again
- another State, adding / Adding another State
- OnGUI(), adding / Adding OnGUI to the StateManager class, Time for action – adding OnGUI to StateManager
- StateManager script
- about / Following the State Machine logic flow
- features / Following the State Machine logic flow
- States and Scenes diagram / What just happened?
- StateUpdate() method / Delegating game control to a State, Time for action – modifying BeginState and add three more States
- string.Format() method / What just happened?
- Switch() method / What just happened?
- SwitchState() method / What just happened?
T
- testing conditions, if statement
- about / Testing conditions with an if statement
- false / Testing if conditions are true or false
- true / Testing if conditions are true or false
- changing, NOT operator used / Using the NOT operator to change the condition
- multiple conditions, checking / Checking many conditions in an if statement, What just happened?, Have a go hero – change the value assigned to temperature
- heBearMadeBigPottyInTheWoods, changing / Have a go hero – change theBearMadeBigPottyInTheWoods to false
U
- Unity
- working in, Game-Creator hat used / By using a little Unity magic, a script becomes a Component, A more technical look at the magic
- about / Applying your new coding skills to a State Machine
- scripting documentation / Easing into Unity's scripting documentation
- State Machine, setting up / In Unity
- MonoDevelop, setting up / In MonoDevelop, What just happened?
- Unity 3D
- Unity coding
- Unity Inspector
- component properties / Understanding Component properties in Unity's Inspector
- Unity Project
- coding / Coding a Unity Project, Working with objects
- Update() method / The Update method is called over and over and over…, Calling the Restart method of the StateManager
- user input based decisions
- making / Making decisions based on user input
- using statement
- code files, locating with / Locating code files with a using statement
V
- value, returning from methods
- AddTwoNumbers(), using / Time for action – returning a value from AddTwoNumbers(), What just happened?
- variables
- naming / Naming your variables properly
- naming, conventions / Begin variable names with lowercase
- multi-word variable names, using / Using multi-word variable names
- declaring / Declaring a variable and its type
- built-in variable types / The most common built-in variable types
- declaring, location / Where you declare a variable is important
- scope / Variable scope – determining where a variable can be used
W
- while loop
- using / Using the while loop
- data, finding / Time for action – finding data and breakout of the while loop, What just happened?
- breakout, finding / Time for action – finding data and breakout of the while loop, What just happened?
- WonState class / Have a go hero – changing the State switching order, Verifying the code of your classes
- WonStates class / Setup the State Machine and add a Player GameObject