1234567891011121314151617181920212223242526272829303132 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public enum WaypointType { slalom1, slalom2, finish};
- public class SlalomPassed : MonoBehaviour
- {
- public WaypointType type;
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- private void OnTriggerEnter(Collider other)
- {
- if (other.CompareTag("bike"))
- {
- // Set finished in statistics, so success is logged
- var bikePlayer = GameObject.Find("bike");
- var playerStats = bikePlayer.GetComponent<PlayerStats>();
- Debug.Log("Waypoint passed");
- playerStats.SetWaypointPassed(type);
- }
- }
- }
|