|
@@ -0,0 +1,32 @@
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using UnityEngine;
|
|
|
+
|
|
|
+public enum WaypointType { slalom1, slalom2, finish};
|
|
|
+public class SlalomPassed : MonoBehaviour
|
|
|
+{
|
|
|
+ public WaypointType type;
|
|
|
+
|
|
|
+ void Start()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ void Update()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnTriggerEnter(Collider other)
|
|
|
+ {
|
|
|
+ if (other.CompareTag("bike"))
|
|
|
+ {
|
|
|
+
|
|
|
+ var bikePlayer = GameObject.Find("bike");
|
|
|
+ var playerStats = bikePlayer.GetComponent<PlayerStats>();
|
|
|
+ Debug.Log("Waypoint passed");
|
|
|
+ playerStats.SetWaypointPassed(type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|