void OnTriggerEnter2D(Collider2D col) { tiempoViaje = GameObject.Find("Contador").GetComponent <Contador_viaje>(); if (col.gameObject.name == "auto rojo" && tiempoViaje.isInicio(this.gameObject.name)) { tiempoViaje.iniciarViaje(); resetMarcadorIni(); } }
void Start() { marcador_fin = GameObject.Find("destinoMarker"); tiempoViaje = GameObject.Find("Contador").GetComponent <Contador_viaje>(); }