Index
A
- AddExplosionForce() function / Classified Intel
- AddField() function / Classified Intel
- AddForce() function / Classified Intel
- addshadow parameter / Required parameters
- AIController / Are you ready to go gung ho? A Hotshot challenge
- AIController script / Engage Thrusters , Engage thrusters, Engage Thrusters, Objective Complete - Mini Debriefing, Game over-Wrapping it up, Mission briefing, Your Hotshot Objectives, Optimizing the AIController script, Prepare for Lift Off , Objective Complete - Mini Debriefing, Classified Intel, Engage Thrusters
- enemy movement, creating with / Creating the enemy movement with AIController script, Engage Thrusters, Objective Complete - Mini Debriefing, Classified Intel
- optimizing / Optimizing the AIController script, Prepare for Lift Off , Engage Thrusters
- Jump(_direction $ Vector3) function / Engage Thrusters
- AI Enemy
- creating / Creating an enemy AI, Engage thrusters
- Waypoints object / Creating an enemy AI
- Aim button / Mission briefing
- alpha parameter / Required parameters
- alphatest$VariableName parameter / Required parameters
- animation.CrossFade() function / Classified Intel
- Animation class / What does it do?
- approxview parameter / Required parameters
- AudioSource script / Engage Thrusters
- Awake() / Engage Thrusters
- Awake() function / Classified Intel, Engage Thrusters , Engage Thrusters, Engage Thrusters , Engage Thrusters, Engage Thrusters
- Awake function
- AwayFromWaypoint() function / Objective Complete - Mini Debriefing
B
- Blinn-Phong
- about / What does it do?
- bool, data type / Data type
- box collider
- about / Box Collider and Mesh Collider
- built-in script
- bump map
C
- C#
- and JavaScript, syntax differences / YieldInstruction and coroutine
- camera
- creating / Creating a camera and a level, Prepare for Lift Off
- creating, steps / Engage Thrusters
- working / Objective Complete - Mini Debriefing
- tips / Classified Intel
- casting
- about / Casting
- ceil( x ), method / Common methods to create shaders
- Cg/HLSL programming
- about / Cg/HLSL programming
- shader properties, accessing / Accessing shader properties in Cg/HLSL
- shader properties, accessing example / Example:
- CGPROGRAM...ENDCG block / Surface shaders
- Chapter8.zip package / Mission Checklist
- character
- setting up, with first-person controller prefab / Setting up the character with the first-person controller prefab, Prepare for Lift Off, Engage Thrusters, Classified Intel
- character animation
- CharacterCamera / Classified Intel
- CharacterCamera script / Engage Thrusters
- CharacterControl class
- creating / Creating CharacterControl class and SpriteManager class
- creating, steps / Prepare for Lift Off , Engage Thrusters
- CharacterController / Engage thrusters
- character controller
- Character Controller class / What does it do?
- CharacterController class / What does it do?, Objective Complete - Mini Debriefing
- Character Controller component / What does it do?
- Character Controller package / Prepare for Lift Off
- CharacterController script / Game over-Wrapping it up
- Character Controllers package / Prepare for Lift Off
- CharacterControl script / Classified Intel , Engage Thrusters , Game over-Wrapping it up , What does it do?, Your Hotshot Objectives, Engage Thrusters, Engage Thrusters
- character literals / Character literals not supported
- CharacterMotor script / What does it do?
- class declarations / Class declarations
- class keyword / Objective Complete - Mini Debriefing
- CollisionFlags parameter / Engage Thrusters
- Controller prefab / Objective Complete - Mini Debriefing
- ConvertStringtoInt() function / Engage Thrusters
- Coroutine
- cross( A , B ), method / Common methods to create shaders
- crossFade() / Creating the rocket launcher and scope target
- CrossFade animation
- creating / Creating CrossFade animation, Engage Thrusters , Classified Intel
- custom character control script
- custom shader
- creating / Mission briefing , What does it do?
- applying, to character model / Mission briefing , What does it do?
- creating, steps / Your Hotshot Objectives
D
- 2D character
- creating / Creating a 2D character, Prepare for Lift Off
- creating, steps / Engage Thrusters
- working / Objective Complete - Mini Debriefing
- box collider / Box Collider and Mesh Collider
- mesh collider / Box Collider and Mesh Collider
- 3D file
- exporting / Exporting from 3D Studio Max
- 3D Studio Max
- exporting from / Exporting from 3D Studio Max, Engage Thrusters
- data type, Cg/HLSL programming
- decal
- add parameter / Required parameters
- decal$blend parameter / Required parameters
- Destroy() function / Game over-Wrapping it up
- destructible wall
- creating / Creating a destructible wall, Engage Thrusters
- diffuse map
- diffuse reflection / What does it do?
- DoMyWindow() function / Objective Complete - Mini Debriefing
- door
- creating / Creating a key and door
- creating, steps / Engage Thrusters
- doorOpen texture / Engage Thrusters
- dot( a, b ), method / Common methods to create shaders
- dualforward parameter / Required parameters
E
- Enemy game object / Engage thrusters
- enemy movement
- creating, with AIController script / Creating the enemy movement with AIController script, Engage Thrusters, Objective Complete - Mini Debriefing, Classified Intel
- enum objects / Classified Intel
- enum parameter / Classified Intel
- equipment tab
- creating / Creating an equipment tab
- parameters, adding / Engage Thrusters
- EquipWindow()function / Engage Thrusters
- exclude_path$forward parameter / Required parameters
- exclude_path$prepass parameter / Required parameters
- Exporting package window / Classified Intel
- Export Package button / Classified Intel
- e_page parameters / Objective Complete - Mini Debriefing
F
- FBX folder / Engage Thrusters
- Fire() function / Objective Complete - Mini Debriefing, Engage Thrusters
- Fire function / Engage Thrusters
- first-person controller prefab
- character, setting up with / Setting up the character with the first-person controller prefab, Prepare for Lift Off, Engage Thrusters, Classified Intel
- First Person Controller object / Engage Thrusters
- fixed, data type / Data type
- fixed parameter / Objective Complete - Mini Debriefing
- FixedUpdate
- about / FixedUpdate
- example / Example
- float, data type / Data type
- float3 viewDir, type / Example:
- float3 worldNormal, type / Example:
- float3 worldNormal; INTERNAL_DATA, type / Example:
- float3 worldPos, type / Example:
- float3 worldRefl, type / Example:
- float3 worldRefl; INTERNAL_DATA, type / Example:
- float4 screenPos, type / Example:
- float variable / Classified Intel
- floor( x ), method / Common methods to create shaders
- Fluffy Smoke object / Engage Thrusters
- Fonts folder / Setting up the character with the first-person controller prefab
- Foreach keyword / The foreach keyword
- FPSInputController file / Prepare for Lift Off
- FPSInputController script / What does it do?, Creating the New3PSController and MouseLook_JS scripts
- fullforwardshadows parameter / Required parameters
- function definitions / Function/method definitions
G
- GameObject.FindWithTag / Awake
- gameObject.GetComponentsInChildren.<Rigidbody>() function / Engage Thrusters
- GAMEOVER menu / Objective Complete - Mini Debriefing
- GameoverPage() function / Engage Thrusters, Objective Complete - Mini Debriefing, Engage Thrusters, Engage Thrusters
- generics / Generics
- GetComponentsInChildren() function / Classified Intel
- GetComponentsInChildren(Transform) function / Classified Intel
- GetComponentsInChildren.<T>() function / Classified Intel
- getDirection() function / Objective Complete - Mini Debriefing
- GetDirectionToPlayer() function / Objective Complete - Mini Debriefing
- GetScore() function / Objective Complete - Mini Debriefing
- GetScores() function / Engage Thrusters
- getters
- properties with / Properties with getters/setters
- gizmos
- creating / Creating the waypoint and gizmos
- lift off, preparing for / Prepare for Lift Off
- JavaScript file, creating / Engage Thrusters
- Awake() function / Engage Thrusters
- Start() function / Engage Thrusters
- AIController script / Engage Thrusters
- OnDrawGizmos() function / Engage Thrusters
- Gizmos() function / Game over-Wrapping it up
- Gizmos.DrawIcon() / Engage Thrusters
- Gizmos.DrawIcon() function / Creating the waypoint and gizmos
- Gizmos.DrawLine() / Engage Thrusters
- Gizmos.DrawWireSphere() / Engage Thrusters
- Gizmos.DrawWireSphere() function / Creating the waypoint and gizmos
- Gizmos folder / Mission Checklist
- gravity property / Engage Thrusters
- GUI.BeginGroup() / Objective Complete - Mini Debriefing, Classified Intel
- GUI.BeginGroup() function / Classified Intel, Game over-Wrapping it up
- GUI.Label() function / Classified Intel
- GUI.tooltip parameter / Classified Intel
- GUI class / Mission briefing , Why Is It Awesome? , Game over-Wrapping it up
- GUIContent array / Engage Thrusters
- GUI function / Engage Thrusters
- GUIText object / Mission briefing
- GUITexture object / Mission briefing , What does it do?, Why Is It Awesome?, Engage Thrusters
H
- Hack and Slash style game / Mission briefing
- half, data type / Data type
- halfasview parameter / Required parameters
- Heroine_animate / Classified Intel , Engage Thrusters
- Heroine_animate object / Engage Thrusters
- Heroine_BuiltIn prefab / Engage Thrusters
- high score
- loading, to server / Posting and loading high scores to the server, Engage Thrusters
- posting, to server / Posting and loading high scores to the server, Engage Thrusters
- StartCoroutine() function / Objective Complete - Mini Debriefing
- ServerHiScore script / Objective Complete - Mini Debriefing
- AddField() function / Classified Intel
- high score menu
- about / Creating a high score menu
- creating / Creating a high score menu
- Lift Off, preparing for / Prepare for Lift Off
- GAMEOVER menu, creating / Engage Thrusters
- GameoverPage() function / Engage Thrusters, Objective Complete - Mini Debriefing
- LocalScorePage() function / Engage Thrusters, Objective Complete - Mini Debriefing
- ServerScorePage() function / Engage Thrusters
- LOCAL HI-SCORE button / Engage Thrusters
- GAMEOVER menu / Objective Complete - Mini Debriefing
- OnGui() function / Objective Complete - Mini Debriefing
- e_page parameters / Objective Complete - Mini Debriefing
- enum parameter / Classified Intel
- enum objects / Classified Intel
- saving / Saving and loading the local high score
- loading / Saving and loading the local high score
- lift off, preparing for / Prepare for Lift Off
- thrusters, engaging / Engage Thrusters
- HiScore game object / Classified Intel
- HiScore script / Engage Thrusters
- hit-point UI
- creating / Creating a hit-point UI
- HitPointUI script / Engage Thrusters
- Update() function / Engage Thrusters
- HitPointUI game object / Engage Thrusters
- GUI.BeginGroup() / Objective Complete - Mini Debriefing, Classified Intel
- GUI.BeginGroup() function / Classified Intel
- AIController / Are you ready to go gung ho? A Hotshot challenge
- HitPointUI game object / Engage Thrusters
- HitPointUI script / Creating a hit-point UI, Engage Thrusters
- Horizontal button / Input Manager
I
- Init() function / Engage Thrusters
- Input struct / Classified Intel
- Instantiate() function / Classified Intel, Game over-Wrapping it up, Objective Complete - Mini Debriefing
- Instatiate() function / Game over-Wrapping it up
- int, data type / Data type
- inventory tab
- creating / Creating an inventory tab, Engage Thrusters
- working / Objective Complete - Mini Debriefing
- Invoke() function / Engage Thrusters, Classified Intel
- InvokeRepeating() function / Classified Intel
- isKinematic method / Are you ready to go gung ho? A Hotshot challenge
- Item class / Engage Thrusters , Objective Complete - Mini Debriefing
- ItemWindow() function / Engage Thrusters
- itemWindow() function / Objective Complete - Mini Debriefing
J
- JavaScript
- and C#, syntax differences / YieldInstruction and coroutine
- Jump() function / Engage Thrusters, Classified Intel, Engage Thrusters
- Jump(_direction $ Vector3) function / Engage Thrusters
K
- key
- creating / Creating a key and door
- creating, steps / Engage Thrusters
- KillObject() function / Engage Thrusters, Objective Complete - Mini Debriefing
L
- Lambert / What does it do?
- LateUpdate
- about / LateUpdate
- example / Example
- LateUpdate() function / Engage Thrusters , Engage Thrusters, Engage Thrusters , Classified Intel , Game over-Wrapping it up
- level
- Level folder / Setting up the character with the first-person controller prefab
- LightingRampSpecular() / Engage Thrusters
- LightingRampSpecular() function / Objective Complete - Mini Debriefing
- lightModel / Required parameters
- limited interface support / Limited interface support
- LoadGameLocal() function / Engage Thrusters, Objective Complete - Mini Debriefing
- LoadLocal() function / Objective Complete - Mini Debriefing
- LoadName() function / Engage Thrusters
- LoadXMLData() function / Objective Complete - Mini Debriefing
- LOCAL HI-SCORE button / Engage Thrusters
- LocalHiScore script / Engage Thrusters
- LocalScorePage() function / Engage Thrusters, Objective Complete - Mini Debriefing, Engage Thrusters
- lowleg_R / Engage Thrusters
M
- max( a, b ), method / Common methods to create shaders
- maxRotateY parameters / Engage Thrusters
- MenuInRPG scene / Prepare for Lift Off
- menu object
- creating / Creating a menu object, Prepare for Lift Off
- creating, steps / Engage Thrusters
- mesh collider
- about / Box Collider and Mesh Collider
- Mesh Renderer component / Engage Thrusters
- method definitions / Function/method definitions
- min( a , b ), method / Common methods to create shaders
- mission briefing
- about / Mission briefing
- MonoBehaviour / Update, LateUpdate
- MonoBehaviours script / Coroutines
- MonoDevelop / Prepare for Lift Off
- MouseLook built-in script / Creating the New3PSController and MouseLook_JS scripts, Prepare for Lift Off
- mouseLook parameters / Engage Thrusters
- MouseLook script / What does it do?, Classified Intel
- MouseLook_JS script / Your Hotshot Objectives, Creating the New3PSController and MouseLook_JS scripts, Classified Intel
- MouseLook_JS scripts
- Move() function / What does it do?, Engage Thrusters , Classified Intel , Game over-Wrapping it up
- multi-dimensional array declaration
- M_Character / Engage Thrusters
N
- Name parameter / Engage Thrusters
- New3PSController
- New3PSController script / Your Hotshot Objectives, Prepare for Lift Off, Engage Thrusters, Your Hotshot Objectives
- new keyword / The new keyword
- Noambient parameter / Required parameters
- Noforwardadd parameter / Required parameters
- nolightmap parameter / Required parameters
- normalize( v ), method / Common methods to create shaders
- novertexlights parameter / Required parameters
O
- OnDrawGizmos
- about / OnDrawGizmos
- example / Example
- OnDrawGizmos() function / Objective Complete - Mini Debriefing, What does it do?, Creating the waypoint and gizmos, Engage Thrusters , Objective Complete - Mini Debriefing, Classified Intel, Engage Thrusters
- OnGUI
- OnGUI() / Engage Thrusters
- OnGui() function / Objective Complete - Mini Debriefing
- OnGUI() function / Game over-Wrapping it up, Are you ready to go gung ho? A Hotshot challenge, Engage Thrusters
- OnGUI function / Game over-Wrapping it up , Mission briefing
- OnTriggerEnter() function / Engage Thrusters
- out keyword / Objective Complete - Mini Debriefing
P
- #pragma surface, surface shaders
- parameters / Required parameters
- surfaceFunction / Required parameters
- lightModel / Required parameters
- Optional parameters [optionalparams] / Required parameters
- #pragma surface, surface shaders;about / #pragma surface
- #pragma surface, surface shaders;parameters / Required parameters
- #pragma surface ... directive / Surface shaders
- ParentRocks script / What does it do?
- Parse(string xml) function / Objective Complete - Mini Debriefing
- particles
- Phong
- about / What does it do?
- Physics.CapsuleCast / Are you ready to go gung ho? A Hotshot challenge
- Physics.CapsuleCast() / Engage Thrusters, Objective Complete - Mini Debriefing
- Physics.CapsuleCast() function / Classified Intel
- Physics.OverlapSphere() function / Objective Complete - Mini Debriefing
- Physics.RayCast / Are you ready to go gung ho? A Hotshot challenge
- Physics.RayCast() / Objective Complete - Mini Debriefing
- Physics.Raycast() function / Engage Thrusters
- Physics class function / Engage Thrusters
- Play button / Engage Thrusters
- play button / Classified Intel
- PlayerPrefs class / Mission briefing
- pow( x , y ), method / Common methods to create shaders
- Prefabs folder / Engage Thrusters
- Project window / Classified Intel
- Properties block / ShaderLab properties
R
- ragdoll
- creating / Creating a ragdoll, Engage Thrusters
- Raycast
- about / Jumping and physics
- Physics.Raycast / Physics.Raycast
- references
- URLs / Reference
- Reload() function / Engage Thrusters
- Remove Component / Engage Thrusters
- replay button
- adding / Adding a sound and replay button
- adding, steps / Engage Thrusters
- Restart button / Mission briefing, Your Hotshot Objectives
- restart button / Mission briefing
- rigidbody / What does it do?, Objective Complete - Mini Debriefing
- rigidbody object / Classified Intel
- robot prefab / Objective Complete - Mini Debriefing
- robot_AI_ragdoll / Engage Thrusters
- robot_AI_ragdoll game object / Prepare for Lift Off , Engage Thrusters
- robot_AI_ragdoll prefab / Prepare for Lift Off , Engage Thrusters
- rocket bullet UI
- Rocket folder / Setting up the character with the first-person controller prefab
- rocket launcher
- RocketLauncher game object / Engage thrusters
- RocketLauncher object / Engage Thrusters, Classified Intel
- RocketLauncher prefab / Objective Complete - Mini Debriefing
- RocketLauncher script / Engage Thrusters, Engage Thrusters
- rockets
- Rocket script / Engage Thrusters, Objective Complete - Mini Debriefing
- rocket script / Game over-Wrapping it up
- Rock script / What does it do?
- rockslide
- Rockslide game object / Engage Thrusters, Game over-Wrapping it up
- Rockslide object / Creating a rockslide and trigger area
- roothandle / Engage Thrusters
- round( x ), method / Common methods to create shaders
S
- sampler, data type / Data type
- saturate( x ), method / Common methods to create shaders
- SaveLocal() function / Engage Thrusters
- script / Engage Thrusters
- SendScore() function / Objective Complete - Mini Debriefing
- ServerScorePage() function / Engage Thrusters, Engage Thrusters
- setters
- properties with / Properties with getters/setters
- setTimeOut() function / Classified Intel
- SetupRotation() function / Engage Thrusters
- ShaderLab
- properties / ShaderLab properties
- ShaderLab properties
- about / ShaderLab properties
- example / Example
- shader programming
- shaders, Cg/HLSL programming
- methods, for creating / Common methods to create shaders
- Shoot() function / Engage Thrusters
- ShotSmoke prefab / Engage Thrusters, Mission Checklist
- ShowArmor() function / Engage Thrusters
- ShowWeapon() function / Engage Thrusters
- Skinned Mesh / Objective Complete - Mini Debriefing
- softvegetation parameter / Required parameters
- SortUser (array
- UsersData[]) function / Engage Thrusters, Objective Complete - Mini Debriefing
- sound button
- adding / Adding a sound and replay button
- adding, steps / Engage Thrusters
- speed parameter / Classified Intel
- SpriteManager class / Engage Thrusters , Objective Complete - Mini Debriefing , Engage Thrusters, Objective Complete - Mini Debriefing, Are you ready to go gung ho? A Hotshot challenge
- creating / Creating CharacterControl class and SpriteManager class
- creating, steps / Prepare for Lift Off , Engage Thrusters
- working / Objective Complete - Mini Debriefing
- Standard Assets folder / Mission Checklist
- start
- Start() function / Engage Thrusters , Engage Thrusters , Engage Thrusters , Engage Thrusters , Engage Thrusters , Engage Thrusters , Engage Thrusters, Engage Thrusters, Engage Thrusters, Objective Complete - Mini Debriefing, Engage Thrusters, Objective Complete - Mini Debriefing
- StartCoroutine
- about / StartCoroutine
- using, iwth method name (string) / Using StartCoroutine with method name (string)
- StartCoroutine function / StartCoroutine
- Start function / Engage Thrusters , Awake
- Start parameter / Engage Thrusters
- STATUS tab / What does it do?
- status tab
- creating / Creating a status tab
- status parameters, assigning / Engage Thrusters
- StatusWindow() function / Engage Thrusters
- StopAllCoroutines
- example / Example
- StopCoroutine
- about / StopCoroutine
- example / Example
- struct properties
- changing, by value / Changing Struct properties by value VS by reference
- changing, by reference / Changing Struct properties by value VS by reference
- SubShader section / Engage Thrusters
- surf() function / Shader programming—Ambient and specular light, Engage Thrusters , Objective Complete - Mini Debriefing , Engage Thrusters
- surfaceFunction / Required parameters
- SurfaceOutput struct / Classified Intel
- SurfaceOutput structure / Surface shaders
- surface shaders
- about / What does it do?, Surface shaders
- #pragma surface / #pragma surface
- input structure / Surface shaders input structure
- input structure, example / Example:
- SurfaceOutput structure / SurfaceOutput structure
T
- tex2D() function / Objective Complete - Mini Debriefing , Objective Complete - Mini Debriefing
- tex2D(sampler, x ), method / Common methods to create shaders
- TextureButton class / Engage Thrusters
- third-person camera
- creating, to follow camera / Creating a third-person camera to follow our character, Engage Thrusters , Classified Intel , Game over-Wrapping it up
- Third-person Camera script / Engage Thrusters
- Third-person Camera scripts / Prepare for Lift Off
- trigger area
- triggerArea game object / Game over-Wrapping it up
- TriggerArea object / Engage Thrusters
- TriggerArea script / What does it do?, Creating a rockslide and trigger area, Engage Thrusters, Objective Complete - Mini Debriefing
- trigger parameter / Objective Complete - Mini Debriefing
- type names
- about / Type names
U
- unitypackage / Classified Intel
- Unity Script Directives
- about / Unity Script Directives
- Unity ShaderLab forum
- URL / Game over-Wrapping it up
- Unity Shader Reference
- URL / Game over-Wrapping it up
- Unity website
- URL / Mission Checklist
- update
- update() function / Objective Complete - Mini Debriefing
- Update() function / Engage Thrusters , Engage Thrusters, Engage Thrusters , Engage Thrusters , Classified Intel , Engage Thrusters, Objective Complete - Mini Debriefing, Engage Thrusters, Engage Thrusters, Engage Thrusters, Engage Thrusters, Objective Complete - Mini Debriefing
- Update functions / Engage Thrusters
- upleg_R / Engage Thrusters
- UserLength() function / Engage Thrusters
- userName parameter / Objective Complete - Mini Debriefing
V
- variable declaration
- about / Variable declaration
- Vector3.Slerp() / Engage Thrusters
- vertex$VertexFunction parameter / Required parameters
W
- WaitForFixedUpdate
- example / WaitForFixedUpdate
- WaitForSeconds
- example / Example
- WaitingForResponse() function / Objective Complete - Mini Debriefing
- Wall game object / Engage Thrusters
- WarpMode parameter / Engage Thrusters
- waypoint
- creating / Creating the waypoint and gizmos
- lift off, preparing for / Prepare for Lift Off
- Awake() function / Engage Thrusters
- Start() function / Engage Thrusters
- AIController script / Engage Thrusters
- OnDrawGizmos() function / Engage Thrusters , Objective Complete - Mini Debriefing, Classified Intel
- Waypoints script / Engage Thrusters , Objective Complete - Mini Debriefing
- Waypoint game object / Engage Thrusters
- script / Engage Thrusters
- getDirection() function / Objective Complete - Mini Debriefing
- GetDirectionToPlayer() function / Objective Complete - Mini Debriefing
- AwayFromWaypoint() function / Objective Complete - Mini Debriefing
- trigger parameter / Objective Complete - Mini Debriefing
- GetComponentsInChildren.<Transform>() function / Classified Intel
- GetComponentsInChildren(Transform) function / Classified Intel
- GetComponentsInChildren() function / Classified Intel
- GetComponentsInChildren.<T>() function / Classified Intel
- Waypoint game object / Engage Thrusters
- waypoint script / Engage Thrusters
- Waypoint script / What does it do?
- Waypoints object / Creating an enemy AI
- Waypoints script / Engage Thrusters , Objective Complete - Mini Debriefing, Creating the enemy movement with AIController script
X
- XML data
- getting, from server / Getting XML data from the server, Objective Complete - Mini Debriefing, Classified Intel
- lift off, preparing for / Prepare for Lift Off
- XMLParser script / Mission briefing, Engage Thrusters
Y
- YieldInstruction
- about / YieldInstruction
- example / Example, Example
- yield statement / Example