Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        RoadWay myScript = (RoadWay)target;

        if (GUILayout.Button("Build Object"))
        {
            myScript.CreateRoad();
        }
        if (GUILayout.Button("AddOne"))
        {
            myScript.AddNode();
        }
    }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public CarContext(RoadWay roadWay, long roadWayDistance) //, long forwardDistance)
 {
     RoadWay         = roadWay;
     RoadWayDistance = roadWayDistance;
     //ForwardDistance = forwardDistance;
 }