Exemple #1
0
 // 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);
 }
Exemple #2
0
 //Add coin function caller;
 public void AddCoin(int value, bool reward = false)
 {
     hud.AddCoin(value, reward);
 }