Пример #1
0
    void Start()
    {
        markerAction = gameObject.GetComponent <MarkerAction>();
        if (markerAction == null)
        {
            throw new Exception("No Marker Action component found.");
        }

        if (lanesParentObject == null)
        {
            lanesParentObject = GameObject.Find("Edges");
        }

        if (traciController == null)
        {
            traciController = FindObjectOfType <TraciController>();
        }

        edgeScript      = lanesParentObject.GetComponent <Edge>();
        triggerAreasSet = false;
    }
    void Start()
    {
        markerAction = gameObject.GetComponent <MarkerAction>();
        if (markerAction == null)
        {
            throw new Exception("No Marker Action component found.");
        }

        if (junctionsParentObject == null)
        {
            junctionsParentObject = GameObject.Find("Junctions");
        }

        if (traciController == null)
        {
            traciController = FindObjectOfType <TraciController>();
        }

        junctionScript  = junctionsParentObject.GetComponent <Junction>();
        triggerAreasSet = false;

        junctionAndTrafficLightIds = new Dictionary <string, string>();
    }