void ResetEnviroment() { if (road != null && !road.Equals(default(RoadObject))) { road.DestroyGameObject(); } InitializeEnviroment(); ClearAgentAccident(); RegisterAccidents(); }
// Update is called once per frame void Update() { if (count % 200 == 0) { Debug.Log("Tester update counter: " + count); } if (count <= 0) { if (road != null && !road.Equals(default(RoadObject))) { road.DestroyGameObject(); } //road = new RoadObject(GetRandomAnchors(8.0f, 10), true, PathSpace.xz, BezierPath.ControlMode.Automatic, 1.0f); } count = (count + 1) % max_count; }