CoinUpdate.cs 694 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Pools;
  5. //Jede Kreuzung die eine Richtungsänderung der Route hervorruft braucht dieses Skript (jedoch nicht die Slalomreferenzpunkte)
  6. public class CoinUpdate : MonoBehaviour
  7. {
  8. private CoinCreation coinCreator;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. coinCreator = GameObject.FindGameObjectWithTag("Route").GetComponent<CoinCreation>();
  13. }
  14. //Keep count of collisions with player
  15. private void OnTriggerEnter(Collider other)
  16. {
  17. if (other.gameObject.CompareTag("bike"))
  18. {
  19. coinCreator.PlaceCoins();
  20. }
  21. }
  22. }