예제 #1
0
파일: Coin.cs 프로젝트: ukibs/Astar
 // Update is called once per frame
 void Update()
 {
     //
     if ((player.position - transform.position).magnitude < distanceToGetCoin)
     {
         // Efecto de coger monead
         //Debug.Log("Moneda cogida");
         hud.AddCoin();
         //
         Destroy(gameObject);
     }
     //
     transform.Rotate(Vector3.forward * rotationSpeed * Time.deltaTime);
 }
예제 #2
0
 //Add coin function caller;
 public void AddCoin(int value, bool reward = false)
 {
     hud.AddCoin(value, reward);
 }