public void GetTrafficLightSet()
    {
        if (mapIntersectionBuilder == null)
        {
            Debug.Log("Please add MapIntersectionBuilder annotation class!");
            return;
        }

        if (mapIntersectionBuilder.intersectionC == null)
        {
            Debug.Log("Please add IntersectionComponent near MapIntersectionBuilder gameobject!");
            return;
        }

        foreach (var item in mapIntersectionBuilder.intersectionC.lightGroups)
        {
            float dot = Vector3.Dot(this.transform.TransformDirection(Vector3.forward), item.transform.TransformDirection(Vector3.forward)); // TODO not vector right usually
            //if (debug) Debug.Log(dot);

            if (dot < -0.7f)
            {
                //if (debug) Debug.Log(dot);
                intersectionTrafficLightSetC          = item;
                intersectionTrafficLightSetC.stopline = this;
            }
        }
    }
Ejemplo n.º 2
0
    public void GetTrafficLightSet()
    {
        foreach (var item in mapIntersectionBuilder.intersectionC.lightGroups)
        {
            float dot = Vector3.Dot(this.transform.TransformDirection(Vector3.forward), item.transform.TransformDirection(Vector3.forward)); // TODO not vector right usually
            //if (debug) Debug.Log(dot);

            if (dot < -0.7f)
            {
                //if (debug) Debug.Log(dot);
                intersectionTrafficLightSetC          = item;
                intersectionTrafficLightSetC.stopline = this;
            }
        }
    }