private void Start() { maxSpeed = 2f; maxSpeedTraffic = TrafficSettings.orangeSpeed; trafficColor = GameObject.Find("Ground (Traffic)").GetComponent <TrafficColor> (); trafficColor.SetColorGreen(); }
private void OnTriggerExit(Collider other) { if (other.gameObject.tag == "Sphere") { if (sphere == null) { sphere = other.gameObject.GetComponent <SphereControl> (); } trafficColor.SetColorGreen(); sphere.SetMaxSpeed(maxSpeed); } }