123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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<Controller.SensorBikeController>().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 IncreaseCollisionCounter()
- {
- collisionCounter += 1;
- }
- public void IncreaseCoinCounter()
- {
- coinCounter += 1;
- }
- }
|