public override void OnInspectorGUI() { DrawDefaultInspector(); RoadWay myScript = (RoadWay)target; if (GUILayout.Button("Build Object")) { myScript.CreateRoad(); } if (GUILayout.Button("AddOne")) { myScript.AddNode(); } }
private static void AddVmsToPortal(IList <VariableMessageSignPortal> portals, bool isLaneSpecific, int?lane, Coordinates coordinates, string id, string hmLocation, string country) { VariableMessageSign vms; if (isLaneSpecific) { vms = new LaneControlSignal { Id = id, Number = lane.Value }; } else { vms = new VariableMessageSign { Id = id }; } var portal = portals.FirstOrDefault(p => p.Coordinates.AreCoordinatesInRange(coordinates) && p.IsLaneSpecific == isLaneSpecific); if (portal == null) { portal = new VariableMessageSignPortal { Coordinates = coordinates, Country = country, IsLaneSpecific = isLaneSpecific }; portals.Add(portal); } var roadWay = portal.RoadWays.FirstOrDefault(r => r.HmLocation == hmLocation); if (roadWay == null) { roadWay = new RoadWay { HmLocation = hmLocation }; portal.RoadWays.Add(roadWay); } roadWay.VariableMessageSigns.Add(vms); }
public CarContext(RoadWay roadWay, long roadWayDistance) //, long forwardDistance) { RoadWay = roadWay; RoadWayDistance = roadWayDistance; //ForwardDistance = forwardDistance; }