Pop Quiz Answers

Chapter 1  Getting to Know Your Environment

Pop quiz  dealing with scripts

Q1 Unity and Visual Studio have a symbiotic relationship.
Q2 Reference Manual.
Q3 None, as it is a reference document, not a test.
Q4 When the new file appears in the Project tab with the filename in edit mode, which will make the class name the same as the filename and prevent naming conflicts.

Chapter 2  The Building Blocks of Programming

Pop quiz  C# building blocks

Q1 Storing a specific type of data for use elsewhere in a C# file.
Q2 Methods store executable lines of code for fast and efficient reuse.
Q3 By adopting MonoBehavior as its parent class and attaching it to a GameObject.
Q4 To access variables and methods of components or files attached to different GameObjects.

Chapter 3  Diving into Variables, Types, and Methods

Pop quiz #1  variables and types

Q1 Using camelCase.
Q2 Declare the variable as public.
Q3 public, private, protected, and internal.
Q4 When an implicit conversion doesn't already exist.

Pop quiz #2  understanding methods

Q1 The type of data returned from the method, the name of the method with parentheses, and a pair of curly brackets for the code block.
Q2 To allow parameter data to be passed into the code block.
Q3 The method will not return any data.
Q4 The Update() method is called every frame.

Chapter 4  Using Collections and Controlling Your Code

Pop quiz #1 – if, and, or but

Q1 True or false
Q2 The NOT operator, written with the exclamation mark symbol (!)
Q3 The AND operator, written with double ampersand symbols (&&)
Q4 The OR operator, written with double bars (||)

Pop quiz #2  all about collections

Q1 The location where data is stored.
Q2 The first element in an array or list is 0, as they are both zero-indexed.
Q3 No  when an array or a list is declared, the type of data it stores is defined, making it impossible for elements to be of different types.
Q4 An array cannot be dynamically expanded once it is initialized, which is why lists are a more flexible choice as they can be dynamically modified.

Chapter 5  Working with Classes, Structs, and OOP

Pop quiz  all things OOP

Q1 The constructor
Q2 By copy, rather than by reference like classes
Q3 Encapsulation, inheritance, composition, and polymorphism
Q4 GetComponent

Chapter 6  Getting Your Hands Dirty with Unity

Pop quiz  basic Unity features

Q1 Primitives
Q2 The z axis
Q3 Drag the GameObject into the Prefabs folder
Q4 Keyframes

Chapter 7  Movement, Camera Controls, and Collisions

Pop quiz  player controls and physics

Q1 Vector3
Q2 InputManager
Q3 A Rigidbody component
Q4 FixedUpdate

Chapter 8  Scripting Game Mechanics

Pop quiz  working with mechanics

Q1 A set or collection of named constants that belong to the same variable
Q2 Using the Instantiate() method with an existing Prefab
Q3 The get and set accessors
Q4 OnGUI()

Chapter 9  Basic AI and Enemy Behavior

Pop quiz  AI and navigation

Q1 It's generated automatically from the level geometry.
Q2 NavMeshAgent
Q3 Procedural programming.
Q4 Don't repeat yourself.

Chapter 10  Revisiting Types, Methods, and Classes

Pop quiz  leveling up 

Q1 Readonly
Q2 Change the number of method parameters or their parameter types.
Q3 Interfaces cannot have method implementations or stored variables.
Q4 Create a type alias to differentiate conflicting namespaces.

Chapter 11  Introducing Stacks, Queues, and HashSets

Pop quiz  intermediate collections

Q1 Stacks
Q2 Peek
Q3 Yes
Q4 ExceptWith

Chapter 12  Exploring Generics, Delegates, and Beyond

Pop quiz  intermediate C#

Q1 Generic classes need to have a defined type parameter.
Q2 The values method and the delegates method signature.
Q3 The -= operator.
Q4 The throw keyword.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.202.167