public static Street CreateStreet(Vector3 _startPos, Vector3 _tangent1, Vector3 _tangent2, Vector3 _endPos, Connection _startConn, Connection _endConn)
        {
            GameObject obj = new GameObject("Street");

            obj.transform.position = _startPos;
            obj.transform.SetParent(Instance.transform);

            obj.gameObject.AddComponent <MeshFilter>();
            MeshRenderer mr = obj.gameObject.AddComponent <MeshRenderer>();

            mr.material = Instance.streetMat;

            Street s = obj.gameObject.AddComponent <Street>();

            GameObject start = new GameObject("Start");
            GameObject end   = new GameObject("End");

            start.transform.position = _startPos;
            end.transform.position   = _endPos;

            obj.tag   = "Street";
            start.tag = "StreetStart";
            end.tag   = "StreetEnd";

            Collider c = start.AddComponent <SphereCollider>();

            c.isTrigger = true;
            c           = end.AddComponent <SphereCollider>();
            c.isTrigger = true;

            start.transform.SetParent(obj.transform);
            end.transform.SetParent(obj.transform);

            Vector3[] pos = new Vector3[] { _startPos, _tangent1, _tangent2, _endPos };

            s.Init(pos, _startConn, _endConn, 20);
            s.m_Spline.CreateGridOPs();
            s.CheckCollision();

            BlockStreetComponentPlacement = true;
            GridManager.CreateGrid(s);
            StreetComponentID_Dic.Add(s.ID, s);
            BlockStreetComponentPlacement = false;

            return(s);
        }
        private static Street CreateCollisionStreet(Vector3 _startPos, Vector3 _tangent1, Vector3 _tangent2, Vector3 _endPos, Connection _startConnection, Connection _endConnection)
        {
            GameObject obj = new GameObject("Street_Col");

            obj.transform.position = _startPos;
            obj.layer = 8;
            obj.transform.SetParent(Instance.StreetCollisionParent.transform);

            MeshFilter   mf = obj.gameObject.AddComponent <MeshFilter>();
            MeshRenderer mr = obj.gameObject.AddComponent <MeshRenderer>();

            mr.material = Instance.streetMatColl;

            Street s = obj.gameObject.AddComponent <Street>();

            Vector3[] pos = new Vector3[] { _startPos, _tangent1, _tangent2, _endPos };

            s.Init(pos, null, null, 20, false);
            return(s);
        }
        /// <summary>
        /// Initialize / Create a CollisionStreet for the Preview
        /// </summary>
        /// <param name="_startPos"></param>
        /// <returns></returns>
        public static Street InitStreetForPreviewColl(Vector3 _startPos)
        {
            GameObject obj = new GameObject("StreetColl_Preview");

            obj.transform.position = _startPos;
            obj.layer = 8;
            obj.transform.SetParent(Instance.StreetCollisionParent.transform);

            obj.gameObject.AddComponent <MeshFilter>();
            MeshRenderer mr = obj.gameObject.AddComponent <MeshRenderer>();

            mr.material = Instance.previewStreetMatColl;

            Street s = obj.gameObject.AddComponent <Street>();

            Vector3[] pos = new Vector3[] { _startPos, _startPos, _startPos, _startPos };

            s.Init(pos, null, null, 20, false, true);

            return(s);
        }