예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         money.addAmount(20);
     }
     else if (Input.GetKeyDown(KeyCode.DownArrow))
     {
         money.subtractAmount(20);
     }
 }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (endPoint.transform.position == this.transform.position)
     {
         Destroy(this.gameObject);
         healthbar.subtractHealth(damageDone);
     }
     if (health <= 0)
     {
         Destroy(this.gameObject);
         moneyBar.addAmount(moneyRewarded);
     }
 }