File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Laser Defender/Assets/Scripts Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class Player : MonoBehaviour {
1919 // Use this for initialization
2020 void Start ( ) {
2121 SetUpMoveBoundaries ( ) ;
22+ StartCoroutine ( PrintAndWait ( ) ) ;
2223 }
2324
2425 // Update is called once per frame
@@ -27,6 +28,13 @@ void Update () {
2728 Fire ( ) ;
2829 }
2930
31+ IEnumerator PrintAndWait ( )
32+ {
33+ Debug . Log ( "First message sent, boss" ) ;
34+ yield return new WaitForSeconds ( 3 ) ;
35+ Debug . Log ( "The second message, yo!" ) ;
36+ }
37+
3038 private void Fire ( )
3139 {
3240 if ( Input . GetButtonDown ( "Fire1" ) )
Original file line number Diff line number Diff line change @@ -94,4 +94,15 @@ Understand the thought process for identifying your priorities for development.
94943 . Give the projectile some velocity so that it shoots upwards.
9595
9696** After watching (learning outcomes)…**
97- Instantiate a project and shoot it upwards.
97+ Instantiate a project and shoot it upwards.
98+
99+
100+ ### 8 Using Coroutines ###
101+
102+ ** In this video (objectives)…**
103+
104+ 1 . Understand the core concept of how a coroutine works.
105+ 2 . Create a simple coroutine that prints to the console, yields for 3 seconds, then prints to the console again.
106+
107+ ** After watching (learning outcomes)…**
108+ Understand the basics of how coroutines work.
You can’t perform that action at this time.
0 commit comments