
- FadeIn has never been turned off since it’s activated

- FadeIn is located on Canvas, where UI button is
- with FadeIn on, the Buttons are under FadeIn (since FadeIn’s opacity is 0, we can’t see them)
- the Buttons can’t be touched

- create a script to turn off FadeIn


- even though we set the second UI Text shrinks automatically as soon as we open the chest, before shrinking the second UI Text was not activated.
- there was nothing to shrink

- in Update() method, the local scale of UI-Text will be turned off when the localScale.y is less than 0
- however, localScale is only set in Update() method.
- there is no chance to access the localScale’s premier value
- in Start() method,
- set the localScale of UI-Text for Unity to access the value
- in Start() method,


- add SpiderAI as a component in the script
- make spiderStatus variable as global by using static variable
- spiderStatus = 0, means the spider is dead
- when spider is dead, disable spiderAI script attached to Spider
setActive() vs enabled
setActive() turns off the gameObject
enabled turns off a component in the gameObject


- create an int variable as an indicator for spider’s attacking
- with another indicator, attackTrigger 1,
- spider stops and the attack animation is player
- IEnumerator TakingDamage() is played
- create IEnumerator TakingDamage()
- when an attack is done, set the indicator, dealDamage is set to 2
- unless spider is dead,
- Player’s health is taken by 1
- wait for 0.5 sec

- make this script reasonalbe
- when Player has only one heart, turn off the second and third ones
- when Player has two hearts, turn off the third one


- create another scene, GameOver
- add UI – RawImage for the black scren
- add UI – Text for GameOver text


- in Build Setting
- add the first scene and the game over scene
- pay attention to the scene numbers

- when Player’s health is 0, load the game over scene





