12345678910111213141516171819202122232425262728293031323334 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Pools;
- using Study;
- //Jede Kreuzung die eine Richtungsänderung der Route hervorruft braucht dieses Skript (jedoch nicht die Slalomreferenzpunkte)
- public class CoinUpdate : MonoBehaviour
- {
- public int routeId = 9;
- private CoinCreation coinCreator;
- //public ConditionManager cm;
- // Start is called before the first frame update
- void Start()
- {
- coinCreator = GameObject.FindGameObjectWithTag("Route").GetComponent<CoinCreation>();
- }
- //Keep count of collisions with player
- private void OnTriggerEnter(Collider other)
- {
- if (other.gameObject.CompareTag("bike"))
- {
- var cm = GameObject.Find("ExperimentManager").GetComponent<ConditionManager>();
- int routeNbr = cm.GetRouteNumber();
- if (routeId == routeNbr) //only use skript for the route it belongs to
- {
- coinCreator.PlaceCoins();
- }
- }
- }
- }
|