using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerStats : MonoBehaviour { public int collisionCounter; public int coinCounter; public string condition; public int hasFinished; public int hasFinishedSlalom1; public int hasFinishedSlalom2; // Start is called before the first frame update void Start() { collisionCounter = 0; coinCounter = 0; hasFinished = -1; hasFinishedSlalom1 = -1; hasFinishedSlalom2 = -1; condition = ""; } // Update is called once per frame void Update() { Debug.Log("Before :" + condition); var bikePlayer = GameObject.Find("BikePlayer - RigidBody"); switch (bikePlayer.GetComponent().steeringSelection) { case SteeringMode.frontWheel: condition = "frontWheel"; break; case SteeringMode.Leaning: condition = "Leaning"; break; case SteeringMode.HMD: condition = "HMD"; break; } Debug.Log("After :" + condition); } public void SetWaypointPassed(WaypointType type) { switch (type) { case WaypointType.slalom1: hasFinishedSlalom1 = 1; break; case WaypointType.slalom2: hasFinishedSlalom2 = 1; break; case WaypointType.finish: hasFinished = 1; break; } } public void IncreaseCollisionCounter() { collisionCounter += 1; } public void IncreaseCoinCounter() { coinCounter += 1; } }