public static void UpdateStreetTangent2Pos(Street _street, Vector3 _tangent2Pos) { _street.m_Spline.SetTangent2Pos(_tangent2Pos); _street.m_Spline.UpdateOPs(_street); if (_street.GetCollisionStreet() != null) { _street.GetCollisionStreet().m_Spline.SetTangent2Pos(_tangent2Pos); _street.GetCollisionStreet().m_Spline.UpdateOPs(_street); } }
/// <summary> /// Create a finshed Street /// </summary> /// <param name="_street">The Preview Street</param> /// <returns>Return the new finished Street</returns> public static Street CreateStreet(Street _street) { CreateCollisionStreet(_street.m_Spline.StartPos, _street.m_Spline.Tangent1Pos, _street.m_Spline.Tangent2Pos, _street.m_Spline.EndPos, _street.GetStartConnection(), _street.m_EndConnection); Destroy(_street.GetCollisionStreet()?.gameObject); Street output = CreateStreet(_street.m_Spline.StartPos, _street.m_Spline.Tangent1Pos, _street.m_Spline.Tangent2Pos, _street.m_Spline.EndPos, _street.GetStartConnection(), _street.m_EndConnection); allStreets.Add(output); return(output); }