Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     rigidbody       = GetComponent <Rigidbody2D>();
     trackDataHolder = GameObject.FindWithTag("TrackData").GetComponent <TrackDataHolder>();
     gripTilemap     = GameObject.FindWithTag("TilemapGrip").GetComponent <Tilemap>();
     StartCoroutine(LeftOrRightChanger());
     StartCoroutine(RandomCornering());
     engineSoundOffset += Random.Range(-0.05f, 0.05f);
 }
 private void OnEnable()
 {
     trackDataHolder = (TrackDataHolder)target;
     wayPoints       = trackDataHolder.trackData.wayPoints;
     if (wayPoints == null)
     {
         wayPoints = new List <WayPoint>();
     }
 }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        trackDataHolder = GameObject.FindWithTag("TrackData").GetComponent <TrackDataHolder>();

        GI = GameObject.FindWithTag("UI_GI").GetComponent <UnityEngine.UI.Slider>();
        BI = GameObject.FindWithTag("UI_BI").GetComponent <UnityEngine.UI.Slider>();

        currentGear = 0;

        gripTilemap = GameObject.FindWithTag("TilemapGrip").GetComponent <Tilemap>();
        camera      = GameObject.FindWithTag("VC").GetComponent <CinemachineVirtualCamera>();
    }