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