Ejemplo n.º 1
0
	public SplinatedMeshMaker AddSplinatedObject(){
        if (SplinatedObjects == null) { SplinatedObjects = new List<SplinatedMeshMaker>(); }
		SplinatedMeshMaker SMM = new SplinatedMeshMaker();
		SMM.Init(GSDSpline,this,transform);
		SplinatedObjects.Add(SMM);
		SMM.SetDefaultTimes(bIsEndPoint,tTime,NextTime,idOnSpline,GSDSpline.distance);
		SMM.StartPos = GSDSpline.GetSplineValue(SMM.StartTime);
		SMM.EndPos = GSDSpline.GetSplineValue(SMM.EndTime);
		return SMM;
	}
Ejemplo n.º 2
0
	public void CopySplinatedObject(ref SplinatedMeshMaker tSMM){
		SplinatedMeshMaker SMM = tSMM.Copy();
		SplinatedObjects.Add(SMM);
		SetupSplinatedMeshes();
	}
Ejemplo n.º 3
0
	public void DoSplineObjects(){
		if(!tNode.CanSplinate()){ return; }
		if(tNode.SplinatedObjects == null){ tNode.SplinatedObjects = new List<GSD.Roads.Splination.SplinatedMeshMaker>(); }
		eCount = tNode.SplinatedObjects.Count;

		SMM = null;
		eCount = tNode.SplinatedObjects.Count;
		if(eCount == 0){ }
		
		for(int i=0;i<tNode.SplinatedObjects.Count;i++){
			currentCount +=1;
			SMM = tNode.SplinatedObjects[i];
			if(SMM.EM == null){
				SMM.EM = new GSD.Roads.Splination.SplinatedMeshMaker.SplinatedMeshEditorMaker();
			}
			SMM.EM.Setup(SMM);
			
			//GSD.Roads.Splination.AxisTypeEnum tAxisTypeSpline = GSD.Roads.Splination.AxisTypeEnum.Z;
			
			EditorGUILayout.BeginVertical("TextArea");

			if(SMM.bNeedsUpdate){ SMM.Setup(true); }

			
			EditorGUILayout.BeginHorizontal();
			
			SMM.bToggle = EditorGUILayout.Foldout(SMM.bToggle,"#"+ currentCount.ToString() + ": " + SMM.tName);
		
			if(GUILayout.Button(btnExtrudeText,GSDImageButton,GUILayout.Width(32f))){
				
			}
			
			if(GUILayout.Button(btnRefreshText,GSDImageButton,GUILayout.Width(16f))){
				SMM.Setup();
			}
			if(GUILayout.Button(btnSaveText,GSDImageButton,GUILayout.Width(16f))){
				GSDSaveWindow tSave = EditorWindow.GetWindow<GSDSaveWindow>();
				tSave.Initialize(ref tSceneRect,GSDSaveWindow.WindowTypeEnum.Extrusion,tNode,SMM);
			}
			if(GUILayout.Button(btnCopyText,GSDImageButton,GUILayout.Width(16f))){
				Undo.RecordObject(tNode,"Copy");
				tNode.CopySplinatedObject(ref SMM);
				EditorUtility.SetDirty(tNode);
			}
			if(GUILayout.Button(btnDeleteText,GSDImageButton,GUILayout.Width(16f))){
				Undo.RecordObject(tNode,"Delete");
				tNode.RemoveSplinatedObject(i);
				EditorUtility.SetDirty(tNode);
			}
			EditorGUILayout.EndHorizontal();
			if(!SMM.bToggle){ EditorGUILayout.EndVertical(); continue; }
			
			GUILayout.Space(8f);
			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.LabelField("General options:");
			if(GUILayout.Button("Online manual",EditorStyles.miniButton,GUILayout.Width(120f))){
				Application.OpenURL("http://microgsd.com/Support/RoadArchitectManual.aspx");
			}
			EditorGUILayout.EndHorizontal();
			
			EditorGUILayout.BeginVertical("box");
			
			//Name:
			SMM.EM.tName = EditorGUILayout.TextField("Name:",SMM.tName);

			//Game object (prefab):
		  	SMM.EM.CurrentSplination = (GameObject)EditorGUILayout.ObjectField("Prefab:",SMM.CurrentSplination,typeof(GameObject), false);
			
			//Game object (prefab start cap):
		  	SMM.EM.CurrentSplinationCap1 = (GameObject)EditorGUILayout.ObjectField("Prefab start cap:",SMM.CurrentSplinationCap1,typeof(GameObject), false);
			//Prefab start cap height offset:
			if(SMM.CurrentSplinationCap1 != null){
				SMM.EM.CapHeightOffset1 = EditorGUILayout.FloatField("  Height offset:",SMM.CapHeightOffset1); 
			}
			
			//Game object (prefab end cap):
		  	SMM.EM.CurrentSplinationCap2 = (GameObject)EditorGUILayout.ObjectField("Prefab end cap:",SMM.CurrentSplinationCap2,typeof(GameObject), false);
			//Prefab end cap height offset:
			if(SMM.CurrentSplinationCap2 != null){
				SMM.EM.CapHeightOffset2 = EditorGUILayout.FloatField("  Height offset:",SMM.CapHeightOffset2); 
			}
			
			//Material overrides:
			SMM.EM.bMaterialOverride = EditorGUILayout.Toggle("Material override: ",SMM.bMaterialOverride); 
			if(SMM.bMaterialOverride){
				SMM.EM.SplinatedMaterial1 = (Material)EditorGUILayout.ObjectField("Override mat #1: ",SMM.SplinatedMaterial1,typeof(Material), false);
				SMM.EM.SplinatedMaterial2 = (Material)EditorGUILayout.ObjectField("Override mat #2: ",SMM.SplinatedMaterial2,typeof(Material), false);
			}
			
			//Axis:
			SMM.EM.Axis = (GSD.Roads.Splination.AxisTypeEnum)EditorGUILayout.Popup("Extrusion axis: ",(int)SMM.Axis,TheAxisDescriptions_Spline,GUILayout.Width(250f));
			
			//Start time:
			if(SMM.StartTime < tNode.MinSplination){ SMM.StartTime = tNode.MinSplination; }
			if(SMM.EndTime > tNode.MaxSplination){ SMM.EndTime = tNode.MaxSplination; }
			EditorGUILayout.BeginHorizontal();
			SMM.EM.StartTime = EditorGUILayout.Slider("Start param: ",SMM.StartTime,tNode.MinSplination,tNode.MaxSplination-0.01f);	
			if(GUILayout.Button("match node",EditorStyles.miniButton, GUILayout.Width(80f))){
				SMM.EM.StartTime = tNode.tTime;
			}
			if(SMM.EM.StartTime >= SMM.EM.EndTime){ SMM.EM.EndTime = (SMM.EM.StartTime + 0.01f); }
			EditorGUILayout.EndHorizontal();
			
			//End time:
			EditorGUILayout.BeginHorizontal();
			SMM.EM.EndTime = EditorGUILayout.Slider("End param: ",SMM.EndTime,SMM.StartTime,tNode.MaxSplination);	
			if(GUILayout.Button("match next",EditorStyles.miniButton, GUILayout.Width(80f))){
				SMM.EM.EndTime = tNode.NextTime;
			}
			if(SMM.EM.StartTime >= SMM.EM.EndTime){ SMM.EM.EndTime = (SMM.EM.StartTime + 0.01f); }
			EditorGUILayout.EndHorizontal();
			
			//Straight line options:
			if(tNode.IsStraight()){
				if(!SMM.bIsStretch){
					SMM.EM.bIsStretch = EditorGUILayout.Toggle("Straight line stretch:",SMM.bIsStretch); 
				}else{
					EditorGUILayout.BeginVertical("box");
					SMM.EM.bIsStretch = EditorGUILayout.Toggle("Straight line stretch:",SMM.bIsStretch); 
		
					//Stretch_UVThreshold:
					SMM.EM.Stretch_UVThreshold = EditorGUILayout.Slider("UV stretch threshold:",SMM.Stretch_UVThreshold,0.01f,0.5f);
					
					//UV repeats:
					SMM.EM.RepeatUVType = (GSD.Roads.Splination.RepeatUVTypeEnum)EditorGUILayout.Popup("UV stretch axis: ",(int)SMM.RepeatUVType,RepeatUVTypeDescriptions_Spline,GUILayout.Width(250f));
					EditorGUILayout.EndVertical();
				}
			}else{
				SMM.EM.bIsStretch = false;
			}
			
			
			SMM.EM.bTrimStart = EditorGUILayout.Toggle("Trim start:",SMM.bTrimStart); 
			SMM.EM.bTrimEnd = EditorGUILayout.Toggle("Trim end:",SMM.bTrimEnd); 

			//Static option:
			SMM.EM.bStatic = EditorGUILayout.Toggle("Static: ",SMM.bStatic); 
			
			//Splination method
//			SMM.EM.bMatchRoadIncrements = EditorGUILayout.Toggle("Match road increments: ",SMM.bMatchRoadIncrements); 
			SMM.EM.bMatchTerrain = EditorGUILayout.Toggle("Match ground: ",SMM.bMatchTerrain); 
			
			//Vector min/max threshold: 
			EditorGUILayout.BeginHorizontal();
			SMM.EM.MinMaxMod = EditorGUILayout.Slider("Vertex min/max threshold: ",SMM.MinMaxMod,0.01f,0.2f);	
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				SMM.EM.MinMaxMod = 0.05f;
			}
			EditorGUILayout.EndHorizontal();
			
			//Vertex matching precision:
			EditorGUILayout.BeginHorizontal();
			SMM.EM.VertexMatchingPrecision = EditorGUILayout.Slider("Vertex matching precision: ",SMM.VertexMatchingPrecision,0f,0.01f);	
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				SMM.EM.VertexMatchingPrecision = 0.005f;
			}
			EditorGUILayout.EndHorizontal();
			
			//UV repeats:
			if(!SMM.bIsStretch){
				SMM.EM.RepeatUVType = (GSD.Roads.Splination.RepeatUVTypeEnum)EditorGUILayout.Popup("UV repeat axis: ",(int)SMM.RepeatUVType,RepeatUVTypeDescriptions_Spline,GUILayout.Width(250f));
			}
			
			if(SMM.bMatchRoadDefinition){
				EditorGUILayout.BeginVertical("TextArea");
				EditorGUILayout.BeginHorizontal();
				SMM.EM.bMatchRoadDefinition = EditorGUILayout.Toggle("Match road definition: ",SMM.bMatchRoadDefinition); 
				if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
					SMM.EM.bMatchRoadDefinition = false;
				}
				EditorGUILayout.EndHorizontal();
				if(SMM.bMatchRoadDefinition){
					EditorGUILayout.LabelField("  Only use this option if object length doesn't match the road definition.", EditorStyles.miniLabel);	
					EditorGUILayout.LabelField("  Matching road definition requires a UV repeat type.", EditorStyles.miniLabel);	
					EditorGUILayout.LabelField("  If the material fails to scale properly, try flipping the Y rotation.", EditorStyles.miniLabel);	
				}
				//Flip rotation option:
				SMM.EM.bFlipRotation = EditorGUILayout.Toggle("  Flip Y rotation: ",SMM.bFlipRotation);
				EditorGUILayout.EndVertical();
			}else{
				EditorGUILayout.BeginHorizontal();
				SMM.EM.bMatchRoadDefinition = EditorGUILayout.Toggle("Match road definition: ",SMM.bMatchRoadDefinition); 
				if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
					SMM.EM.bMatchRoadDefinition = false;
				}
				EditorGUILayout.EndHorizontal();
			}
			EditorGUILayout.EndVertical();
			
			//Vertical offset:
			EditorGUILayout.LabelField("Vertical options:");
			EditorGUILayout.BeginVertical("box");
			EditorGUILayout.BeginHorizontal();
			SMM.EM.VerticalRaise = EditorGUILayout.Slider("Vertical raise magnitude:",SMM.VerticalRaise,-512f,512f); 
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				SMM.EM.VerticalRaise = 0f; 
			}
			EditorGUILayout.EndHorizontal();
			
			//Vertical curve:
			if(SMM.VerticalCurve == null || SMM.VerticalCurve.keys.Length < 2){ EnforceCurve(ref SMM.VerticalCurve); }
			EditorGUILayout.BeginHorizontal();
			SMM.EM.VerticalCurve = EditorGUILayout.CurveField("Curve: ",SMM.VerticalCurve);	
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				ResetCurve(ref SMM.EM.VerticalCurve);
			}
			EditorGUILayout.EndHorizontal();
			EditorGUILayout.EndVertical();

			//Horizontal offsets:
			SMM.EM.HorizontalSep = SMM.HorizontalSep;
			EditorGUILayout.LabelField("Horizontal offset options:");
			EditorGUILayout.BeginVertical("box");
			tHorizMatching = HorizMatchingDefaultsEnum.None;
			tHorizMatching = (HorizMatchingDefaultsEnum)EditorGUILayout.Popup((int)tHorizMatching,HorizMatchSubTypeDescriptions, GUILayout.Width(100f));
			if(tHorizMatching != HorizMatchingDefaultsEnum.None){
				if(tHorizMatching == HorizMatchingDefaultsEnum.MatchCenter){
					SMM.EM.HorizontalSep = 0f;
				}else if(tHorizMatching == HorizMatchingDefaultsEnum.MatchRoadLeft){
					SMM.EM.HorizontalSep = (tNode.GSDSpline.tRoad.RoadWidth()/2)*-1;
				}else if(tHorizMatching == HorizMatchingDefaultsEnum.MatchShoulderLeft){
					SMM.EM.HorizontalSep = ((tNode.GSDSpline.tRoad.RoadWidth()/2) + tNode.GSDSpline.tRoad.opt_ShoulderWidth)*-1;
				}else if(tHorizMatching == HorizMatchingDefaultsEnum.MatchRoadRight){
					SMM.EM.HorizontalSep = (tNode.GSDSpline.tRoad.RoadWidth()/2);
				}else if(tHorizMatching == HorizMatchingDefaultsEnum.MatchShoulderRight){
					SMM.EM.HorizontalSep = (tNode.GSDSpline.tRoad.RoadWidth()/2) + tNode.GSDSpline.tRoad.opt_ShoulderWidth;
				}
				tHorizMatching = HorizMatchingDefaultsEnum.None;
			}
			EditorGUILayout.BeginHorizontal();
			SMM.EM.HorizontalSep = EditorGUILayout.Slider("Horiz offset magnitude:",SMM.HorizontalSep,(-1f*HorizRoadMax),HorizRoadMax);	
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				SMM.EM.HorizontalSep = 0f;
			}
			EditorGUILayout.EndHorizontal();
			
			//Horizontal curve:
			if(SMM.HorizontalCurve == null || SMM.HorizontalCurve.keys.Length < 2){ EnforceCurve(ref SMM.HorizontalCurve); }

			EditorGUILayout.BeginHorizontal();
			SMM.EM.HorizontalCurve = EditorGUILayout.CurveField("Curve: ",SMM.HorizontalCurve);
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				ResetCurve(ref SMM.EM.HorizontalCurve);
			}
			EditorGUILayout.EndHorizontal();
			EditorGUILayout.EndVertical();
			
			//Vertical cutoff:
			EditorGUILayout.LabelField("Vertical cutoff:");
			EditorGUILayout.BeginVertical("box");
			SMM.EM.bVerticalCutoff = EditorGUILayout.Toggle("Height cutoff enabled:",SMM.bVerticalCutoff); 
			if(SMM.bVerticalCutoff){
				SMM.EM.bVerticalCutoff_MatchZero = EditorGUILayout.Toggle("Match spline height:",SMM.bVerticalCutoff_MatchZero); 
				SMM.EM.bVerticalCutoffDownwards = EditorGUILayout.Toggle("Cut direction toggle:",SMM.bVerticalCutoffDownwards);
				SMM.EM.VerticalCutoff = EditorGUILayout.Slider("Height cut offset: ",SMM.VerticalCutoff,-50f,50f); 
				SMM.EM.bVerticalMeshCutoff_OppositeDir = EditorGUILayout.Toggle("Opposite dir mesh cut:",SMM.bVerticalMeshCutoff_OppositeDir); 
				SMM.EM.VerticalMeshCutoffOffset = EditorGUILayout.Slider("Mesh cut offset: ",SMM.VerticalMeshCutoffOffset,-5f,5f);
			}
			EditorGUILayout.EndVertical();
			
			//End type:
			EditorGUILayout.LabelField("Extrusion ending options:");
			EditorGUILayout.BeginVertical("box");
			SMM.EM.bEndDown = EditorGUILayout.Toggle("Push endings down:",SMM.bEndDown); 
			if(SMM.bEndDown){
				SMM.EM.bEndTypeDownOverride = EditorGUILayout.Toggle("Override down value: ",SMM.bEndTypeDownOverride); 
				if(SMM.bEndTypeDownOverride){
					SMM.EM.EndTypeDownOverride = EditorGUILayout.Slider("Downward movement: ",SMM.EndTypeDownOverride,-10f,10f);	
				}
			}
			EditorGUILayout.EndVertical();

			//Start and end objects:
			EditorGUILayout.LabelField("Start & end objects:");
			EditorGUILayout.BeginVertical("box");
			//End cap custom match start:
			SMM.EM.bEndCapCustomMatchStart = EditorGUILayout.Toggle("Match objects to ends:",SMM.bEndCapCustomMatchStart);
			
			//End objects match ground:
			SMM.EM.bEndObjectsMatchGround = EditorGUILayout.Toggle("Force origins to ground:",SMM.bEndObjectsMatchGround); 
			
			//Start cap:
			EditorGUILayout.BeginVertical("box");
			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.LabelField("Start object:");
			tEndObjectAdd = (EndObjectsDefaultsEnum)EditorGUILayout.Popup((int)tEndObjectAdd,EndObjectsDefaultsEnumDesc);
			if(tEndObjectAdd != EndObjectsDefaultsEnum.None){
				SMM.EM.EndCapStart = GetEndObjectQuickAdd();
				tEndObjectAdd = EndObjectsDefaultsEnum.None;	
			}
			EditorGUILayout.EndHorizontal();
			
			
			SMM.EM.EndCapStart = (GameObject)EditorGUILayout.ObjectField("Prefab:",SMM.EndCapStart,typeof(GameObject), false);
			if(SMM.EndCapStart != null){
				SMM.EM.EndCapCustomOffsetStart = EditorGUILayout.Vector3Field("Position offset:",SMM.EndCapCustomOffsetStart);
				SMM.EM.EndCapCustomRotOffsetStart = EditorGUILayout.Vector3Field("Rotation offset:",SMM.EndCapCustomRotOffsetStart);
			}
			EditorGUILayout.EndVertical();

			//End cap:
			EditorGUILayout.BeginVertical("box");
			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.LabelField("End object:");
			tEndObjectAdd = (EndObjectsDefaultsEnum)EditorGUILayout.Popup((int)tEndObjectAdd,EndObjectsDefaultsEnumDesc);
			if(tEndObjectAdd != EndObjectsDefaultsEnum.None){
				SMM.EM.EndCapEnd = GetEndObjectQuickAdd();
				SMM.EM.EndCapCustomRotOffsetEnd = new Vector3(0f,180f,0f);
				tEndObjectAdd = EndObjectsDefaultsEnum.None;	
			}
			EditorGUILayout.EndHorizontal();
			
			
			SMM.EM.EndCapEnd = (GameObject)EditorGUILayout.ObjectField("Prefab:",SMM.EndCapEnd,typeof(GameObject), false);
			if(SMM.EndCapEnd != null){
				SMM.EM.EndCapCustomOffsetEnd = EditorGUILayout.Vector3Field("Position offset:",SMM.EndCapCustomOffsetEnd); 
				SMM.EM.EndCapCustomRotOffsetEnd = EditorGUILayout.Vector3Field("Rotation offset:",SMM.EndCapCustomRotOffsetEnd);
			}
			EditorGUILayout.EndVertical();
			
			EditorGUILayout.EndVertical();

			//Collision:
			EditorGUILayout.LabelField("Collision options:");
			EditorGUILayout.BeginVertical("box");
			SMM.EM.CollisionType = (GSD.Roads.Splination.CollisionTypeEnum)EditorGUILayout.Popup("Collision type: ",(int)SMM.CollisionType,TheCollisionTypeEnumDescSpline,GUILayout.Width(320f));
			//Mesh collison convex option
			if(SMM.CollisionType != GSD.Roads.Splination.CollisionTypeEnum.None && SMM.CollisionType != GSD.Roads.Splination.CollisionTypeEnum.BoxCollision){
				SMM.EM.bCollisionConvex = EditorGUILayout.Toggle(" Convex: ",SMM.bCollisionConvex); 
				SMM.EM.bCollisionTrigger = EditorGUILayout.Toggle(" Trigger: ",SMM.bCollisionTrigger); 
			}
			
			if(SMM.CollisionType == GSD.Roads.Splination.CollisionTypeEnum.SimpleMeshTriangle || SMM.CollisionType == GSD.Roads.Splination.CollisionTypeEnum.SimpleMeshTrapezoid){
				SMM.EM.bSimpleCollisionAutomatic = EditorGUILayout.Toggle(" Automatic simple collision: ", SMM.bSimpleCollisionAutomatic); 
			}
			//If not automatic simple collisions:
			if(!SMM.bSimpleCollisionAutomatic){
				if(SMM.CollisionType == GSD.Roads.Splination.CollisionTypeEnum.SimpleMeshTriangle){
					SMM.EM.CollisionTriBL = SMM.CollisionTriBL;
					SMM.EM.CollisionTriBR = SMM.CollisionTriBR;
					SMM.EM.CollisionTriT = SMM.CollisionTriT;
					
					EditorGUILayout.LabelField("Bottom left:");
					SMM.EM.CollisionTriBL.x = EditorGUILayout.Slider(" x-axis: ",SMM.CollisionTriBL.x,SMM.mMinX-5f,SMM.mMaxX+5f);
					SMM.EM.CollisionTriBL.y = EditorGUILayout.Slider(" y-axis: ",SMM.CollisionTriBL.y,SMM.mMinY-5f,SMM.mMaxY+5f);
					SMM.EM.CollisionTriBL.z = EditorGUILayout.Slider(" z-axis: ",SMM.CollisionTriBL.z,SMM.mMinZ-5f,SMM.mMaxZ+5f);

					EditorGUILayout.LabelField("Bottom right:");
					SMM.EM.CollisionTriBR.x = EditorGUILayout.Slider(" x-axis: ",SMM.CollisionTriBR.x,SMM.mMinX-5f,SMM.mMaxX+5f);
					SMM.EM.CollisionTriBR.y = EditorGUILayout.Slider(" y-axis: ",SMM.CollisionTriBR.y,SMM.mMinY-5f,SMM.mMaxY+5f);
					SMM.EM.CollisionTriBR.z = EditorGUILayout.Slider(" z-axis: ",SMM.CollisionTriBR.z,SMM.mMinZ-5f,SMM.mMaxZ+5f);
					
					EditorGUILayout.LabelField("Top:");
					SMM.EM.CollisionTriT.x = EditorGUILayout.Slider(" x-axis: ",SMM.CollisionTriT.x,SMM.mMinX-5f,SMM.mMaxX+5f);
					SMM.EM.CollisionTriT.y = EditorGUILayout.Slider(" y-axis: ",SMM.CollisionTriT.y,SMM.mMinY-5f,SMM.mMaxY+5f);
					SMM.EM.CollisionTriT.z = EditorGUILayout.Slider(" z-axis: ",SMM.CollisionTriT.z,SMM.mMinZ-5f,SMM.mMaxZ+5f);

				}else if(SMM.CollisionType == GSD.Roads.Splination.CollisionTypeEnum.SimpleMeshTrapezoid){
					SMM.EM.CollisionBoxBL = EditorGUILayout.Vector3Field(" Bottom left:",SMM.CollisionBoxBL);
					SMM.EM.CollisionBoxBR = EditorGUILayout.Vector3Field(" Bottom right:",SMM.CollisionBoxBR);
					SMM.EM.CollisionBoxTL = EditorGUILayout.Vector3Field(" Top left:",SMM.CollisionBoxTL);
					SMM.EM.CollisionBoxTR = EditorGUILayout.Vector3Field(" Top right:",SMM.CollisionBoxTR);
				}
			}
			
			if(SMM.CollisionType == GSD.Roads.Splination.CollisionTypeEnum.BoxCollision){
				SMM.EM.StretchBC_LocOffset = EditorGUILayout.Vector3Field("Box collider center offset:",SMM.StretchBC_LocOffset);
				SMM.EM.bBCFlipX = EditorGUILayout.Toggle("Flip center X:", SMM.bBCFlipX);
				SMM.EM.bBCFlipZ = EditorGUILayout.Toggle("Flip center Z:", SMM.bBCFlipZ);

				
				SMM.EM.bStretchSize = EditorGUILayout.Toggle("Box collider size edit:",SMM.bStretchSize); 
				if(SMM.bStretchSize){ 
					SMM.EM.StretchBC_Size = EditorGUILayout.Vector3Field("Size:",SMM.StretchBC_Size);
				}else{
					EditorGUILayout.LabelField("Size:",SMM.StretchBC_Size.ToString());
				}	
			}
			EditorGUILayout.EndVertical();
			
			
			EditorGUILayout.LabelField("Rotation options:");
			EditorGUILayout.BeginVertical("box");

			//Custom rotation:
			SMM.EM.CustomRotation = SMM.CustomRotation;
			//EOM.CustomRotation = EditorGUILayout.Vector3Field("Custom rotation: ",EOM.CustomRotation);
			EditorGUILayout.BeginHorizontal();
			//Flip rotation option:
			if(SMM.EM.bFlipRotation != SMM.bFlipRotation){
				SMM.EM.bFlipRotation = EditorGUILayout.Toggle("Flip Y rotation: ",SMM.EM.bFlipRotation); 
			}else{
				SMM.EM.bFlipRotation = EditorGUILayout.Toggle("Flip Y rotation: ",SMM.bFlipRotation); 
			}
			
			
//			if(GUILayout.Button("Reset custom rotation",EditorStyles.miniButton,GUILayout.Width(160f))){
//				SMM.CustomRotation = new Vector3(0f,0f,0f);
//			}
			if(GUILayout.Button(btnDefaultText,GSDImageButton,GUILayout.Width(16f))){
				SMM.EM.CustomRotation = new Vector3(0f,0f,0f);
			}
			EditorGUILayout.EndHorizontal();
//			SMM.EM.CustomRotation = EditorGUILayout.Vector3Field("",SMM.CustomRotation);
//			SMM.EM.CustomRotation.x = EditorGUILayout.Slider("x-axis: ",SMM.CustomRotation.x,-360f,360f);
//			SMM.EM.CustomRotation.y = EditorGUILayout.Slider("y-axis: ",SMM.CustomRotation.y,-360f,360f);
//			SMM.EM.CustomRotation.z = EditorGUILayout.Slider("z-axis: ",SMM.CustomRotation.z,-360f,360f);
			EditorGUILayout.EndVertical();
			EditorGUILayout.EndVertical();	
			
			
			EditorGUILayout.LabelField("Deprecated options:");
			EditorGUILayout.BeginVertical("box");
			SMM.EM.bExactSplination = EditorGUILayout.Toggle("Directional extrusion: ",SMM.bExactSplination);
			
			EditorGUILayout.EndVertical();	
			BigLine();
			BigLine();
		}
	}
Ejemplo n.º 4
0
    private void DoGUI()
    {
        if (bNoGUI)
        {
            return;
        }
        if (oList == null)
        {
            Close(); return;
        }

        GUILayout.Space(4f);
        EditorGUILayout.BeginHorizontal();

        if (tNode.bIsBridgeStart)
        {
            xWindowType = (WindowTypeEnum)EditorGUILayout.Popup("Category: ", (int)tWindowType, WindowTypeDescBridge, GUILayout.Width(312f));
        }
        else
        {
            if (xWindowType == WindowTypeEnum.Edge)
            {
                SxWindowType = WindowTypeEnumShort.Edge;
            }
            else if (xWindowType == WindowTypeEnum.Extrusion)
            {
                SxWindowType = WindowTypeEnumShort.Extrusion;
            }
            else
            {
                SxWindowType = WindowTypeEnumShort.Groups;
            }

            SxWindowType = (WindowTypeEnumShort)EditorGUILayout.Popup("Category: ", (int)StWindowType, WindowTypeDesc, GUILayout.Width(312f));

            if (SxWindowType == WindowTypeEnumShort.Extrusion)
            {
                xWindowType = WindowTypeEnum.Extrusion;
            }
            else if (SxWindowType == WindowTypeEnumShort.Edge)
            {
                xWindowType = WindowTypeEnum.Edge;
            }
            else
            {
                xWindowType = WindowTypeEnum.Groups;
            }
            StWindowType = SxWindowType;
        }

        if (xWindowType != tWindowType)
        {
            Initialize(xWindowType, tNode);
            EditorGUILayout.EndHorizontal();
            return;
        }



        EditorGUILayout.LabelField("");
        EditorGUILayout.LabelField("Single-click items to load", EditorStyles.boldLabel, GUILayout.Width(200f));



        EditorGUILayout.EndHorizontal();
        if (oList.Count == 0)
        {
            return;
        }
        int oCount = oList.Count;

        int WidthSpacing       = 160;
        int HeightSpacing      = 200;
        int HeightOffset       = 30;
        int ScrollHeightOffset = 25;

        int xCount = 0;
        int yCount = 0;
        int yMod   = Mathf.FloorToInt((float)position.width / 142f) - 1;

        int yMax = 0;

        if (yMod == 0)
        {
            yMax = 1;
        }
        else
        {
            yMax = Mathf.CeilToInt((float)oCount / (float)yMod);
        }

        bool bScrolling = false;

        if ((((yMax) * HeightSpacing) + 25) > position.height)
        {
            scrollPos    = GUI.BeginScrollView(new Rect(0, 25, position.width - 10, position.height - 30), scrollPos, new Rect(0, 0, (yMod * WidthSpacing) + 25, (((yMax) * HeightSpacing) + 50)));
            bScrolling   = true;
            HeightOffset = ScrollHeightOffset;
        }

        EditorGUILayout.BeginHorizontal();

        bool bClicked = false;

        for (int i = 0; i < oCount; i++)
        {
            if (i > 0)
            {
                if (yMod == 0)
                {
                    EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); yCount += 1; xCount = 0;
                }
                else
                {
                    if (i % yMod == 0)
                    {
                        EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); yCount += 1; xCount = 0;
                    }
                }
            }

            if (xCount == 0)
            {
                bClicked = DoItem((xCount * WidthSpacing) + 5, (yCount * HeightSpacing) + HeightOffset, i);
            }
            else
            {
                bClicked = DoItem(xCount * WidthSpacing, (yCount * HeightSpacing) + HeightOffset, i);
            }

            if (bClicked)
            {
                if (tWindowType == WindowTypeEnum.Extrusion)
                {
                    GSD.Roads.Splination.SplinatedMeshMaker SMM = tNode.AddSplinatedObject();
                    SMM.SetDefaultTimes(tNode.bIsEndPoint, tNode.tTime, tNode.NextTime, tNode.idOnSpline, tNode.GSDSpline.distance);
                    SMM.LoadFromLibrary(oList[i].FileName, oList[i].bIsDefault);
                    SMM.bIsGSD = oList[i].bIsDefault;
                    SMM.Setup(true);
                }
                else if (tWindowType == WindowTypeEnum.Edge)
                {
                    GSD.Roads.EdgeObjects.EdgeObjectMaker EOM = tNode.AddEdgeObject();
                    EOM.SetDefaultTimes(tNode.bIsEndPoint, tNode.tTime, tNode.NextTime, tNode.idOnSpline, tNode.GSDSpline.distance);
                    EOM.LoadFromLibrary(oList[i].FileName, oList[i].bIsDefault);
                    EOM.bIsGSD = oList[i].bIsDefault;
                    EOM.Setup();
                }
                else if (tWindowType == WindowTypeEnum.Groups)
                {
                    tNode.LoadWizardObjectsFromLibrary(oList[i].FileName, oList[i].bIsDefault, oList[i].bIsBridge);
                }
                else if (tWindowType == WindowTypeEnum.BridgeComplete)
                {
                    tNode.LoadWizardObjectsFromLibrary(oList[i].FileName, oList[i].bIsDefault, oList[i].bIsBridge);
                }
                tNode.bQuitGUI       = true;
                oList.Clear(); oList = null;
                EditorGUILayout.EndHorizontal();
                if (bScrolling)
                {
                    GUI.EndScrollView();
                }
                bNoGUI = true;
                Close();
                return;
            }
            xCount += 1;
        }
        EditorGUILayout.EndHorizontal();

        if (bScrolling)
        {
            GUI.EndScrollView();
        }
    }
Ejemplo n.º 5
0
	private void BridgeAdd_BottomBase(float tHorizSep = 0f, float tVertRaise = -1.01f, string tMat = "Assets/RoadArchitect/Materials/GSDConcrete2.mat", bool bOverridePrefab = false, string OverridePrefab = ""){
		SMM = tNode.AddSplinatedObject();
		string tBridgeBottomBaseToAdd = "";
		string tName = "";
		if(tNode.GSDSpline.tRoad.opt_Lanes == 2){
			if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase2){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase2-18w-5l-3d.fbx";
				tName = "BridgeBase2";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase3){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase3-18w-5l-5d.fbx";
				tName = "BridgeBase3";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase4){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase4-18w-5l-5d.fbx";
				tName = "BridgeBase4";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase5){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase5-18w-5l-5d.fbx";
				tName = "BridgeBase5";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase6){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase6-2L.fbx";
				tName = "BridgeArchBeam80";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase7){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase7-2L.fbx";
				tName = "BridgeArchSolid80";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase8){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase8-2L.fbx";
				tName = "BridgeArchSolid180";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBaseGrid){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBaseGrid-18w-5l-5d.fbx";
				tName = "BridgeGrid";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeSteel){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBaseSteelBeam-18w-20l-3d.fbx";
				tName = "BridgeSteelBeams";
			}
		}else if(tNode.GSDSpline.tRoad.opt_Lanes == 4){
			if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase2){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase2-28w-5l-3d.fbx";
				tName = "BridgeBase2";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase3){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase3-28w-5l-5d.fbx";
				tName = "BridgeBase3";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase4){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase4-28w-5l-5d.fbx";
				tName = "BridgeBase4";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase5){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase5-28w-5l-5d.fbx";
				tName = "BridgeBase5";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase6){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase6-4L.fbx";
				tName = "BridgeArchBeam80";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase7){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase7-4L.fbx";
				tName = "BridgeArchSolid80";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase8){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase8-4L.fbx";
				tName = "BridgeArchSolid180";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBaseGrid){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBaseGrid-28w-5l-5d.fbx";
				tName = "BridgeGrid";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeSteel){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBaseSteelBeam-28w-20l-3d.fbx";
				tName = "BridgeSteelBeams";
			}
		}else{
			if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase2){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase2-38w-5l-3d.fbx";
				tName = "BridgeBase2";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase3){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase3-38w-5l-5d.fbx";
				tName = "BridgeBase3";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase4){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase4-38w-5l-5d.fbx";
				tName = "BridgeBase4";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase5){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase5-38w-5l-5d.fbx";
				tName = "BridgeBase5";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase6){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase6-6L.fbx";
				tName = "BridgeArchBeam80";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase7){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase7-6L.fbx";
				tName = "BridgeArchSolid80";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase8){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase8-6L.fbx";
				tName = "BridgeArchSolid180";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBaseGrid){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBaseGrid-38w-5l-5d.fbx";
				tName = "BridgeGrid";
			}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeSteel){
				tBridgeBottomBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBaseSteelBeam-38w-20l-3d.fbx";
				tName = "BridgeBeams";
			}
		}
		
		if(bOverridePrefab){ tBridgeBottomBaseToAdd = OverridePrefab; }
		
		SMM.CurrentSplination = (GameObject)UnityEditor.AssetDatabase.LoadAssetAtPath(tBridgeBottomBaseToAdd, typeof(GameObject));
		SMM.HorizontalSep = tHorizSep;
		SMM.VerticalRaise = tVertRaise;
		SMM.bMaterialOverride = true;
		SMM.tName = tName;
		
		if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase2){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase3){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase4){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase5){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase6){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase7){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBase8){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeBaseGrid){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial("Assets/RoadArchitect/Materials/GSDSteel7.mat");
		}else if(tBridgeBottomBaseQuickAdd == BridgeBottomBaseDefaultsEnum.BridgeSteel){
			SMM.SplinatedMaterial1 =  GSD.Roads.GSDRoadUtilityEditor.GiveMaterial("Assets/RoadArchitect/Materials/GSDSteel7.mat");
		}
		
		SMM.Axis = GSD.Roads.Splination.AxisTypeEnum.Z;
		
		tBridgeTopBaseQuickAdd = BridgeTopBaseDefaultsEnum.None;
		if(SMM.StartTime < tNode.MinSplination){ SMM.StartTime = tNode.MinSplination; }
		if(SMM.EndTime > tNode.MaxSplination){ SMM.EndTime = tNode.MaxSplination; }
	}
Ejemplo n.º 6
0
	private void ExtrudeHelper(string tPath, string tName, float DefaultHoriz, GSD.Roads.Splination.AxisTypeEnum tAxis = GSD.Roads.Splination.AxisTypeEnum.Z, bool bHorizOverride = false, float tHorizSep = 0f, bool bVertOverride = false, float tVertRaise = 0f, bool bFlipRot = false){
		SMM = tNode.AddSplinatedObject();
		SMM.CurrentSplination = (GameObject)UnityEditor.AssetDatabase.LoadAssetAtPath(tPath, typeof(GameObject));
		
		if(bHorizOverride){
			SMM.HorizontalSep = tHorizSep;
		}else{
			SMM.HorizontalSep = ((tNode.GSDSpline.tRoad.RoadWidth()/2) + tNode.GSDSpline.tRoad.opt_ShoulderWidth)*-1f;
		}
		
		if(bVertOverride){
			SMM.VerticalRaise = tVertRaise;
		}else{
			if(tNode.bIsBridgeStart){ SMM.VerticalRaise = -0.01f; }
		}
		
		SMM.bFlipRotation = bFlipRot;
		SMM.Axis = tAxis;
		if(SMM.StartTime < tNode.MinSplination){ SMM.StartTime = tNode.MinSplination; }
		if(SMM.EndTime > tNode.MaxSplination){ SMM.EndTime = tNode.MaxSplination; }
		SMM.tName = tName;
	}
Ejemplo n.º 7
0
	public void UpdateSplineObjects_OnUndo(){
		if(!tNode.CanSplinate()){ return; }
		if(tNode.SplinatedObjects == null){ tNode.SplinatedObjects = new List<GSD.Roads.Splination.SplinatedMeshMaker>(); }
		
		//Destroy all children:
    	for(int i=tNode.transform.childCount-1;i>=0;i--){
	        Object.DestroyImmediate(tNode.transform.GetChild(i).gameObject);
	    }
		
		//Re-setup the SMM:
		eCount = tNode.SplinatedObjects.Count;
		for(int i=0;i<eCount;i++){	
			SMM = tNode.SplinatedObjects[i];
			SMM.UpdatePositions();
			//if(SMM.bIsStretch != SMM.bIsStretch){ 
				if(SMM.bIsStretch){
					SMM.CollisionType = GSD.Roads.Splination.CollisionTypeEnum.BoxCollision;
					SMM.bMatchRoadDefinition = false;
					SMM.bMatchTerrain = false;
					SMM.bCollisionConvex = false;
					SMM.bEndDown = false;
					SMM.bVerticalCutoff = false;
					SMM.bExactSplination = false;
					SMM.bEndTypeDownOverride = false;
				}
			//}				
			SMM.Setup(true);
		}
		
		UpdateEdgeObjects_OnUndo();
	}
Ejemplo n.º 8
0
	private void BridgeAdd_TopBase(float tHorizSep = 0f, float tVertRaise = -0.01f, string tMat = "Assets/RoadArchitect/Materials/GSDConcrete2.mat", bool bOverridePrefab = false, string OverridePrefab = ""){
		SMM = tNode.AddSplinatedObject();
		string tBridgeTopBaseToAdd = "";
		string tName = "";
		if(tNode.GSDSpline.tRoad.opt_Lanes == 2){
			if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base1MOver){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-19w-5l-1d.fbx";
				tName = "BridgeTop1M-1M";
			}else if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base2MOver){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-20w-5l-1d.fbx";
				tName = "BridgeTop2M-1M";
			}else if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base3MDeep){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-18w-5l-3d.fbx";
				tName = "BridgeTop0M-3M";
			}else{
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-18w-5l-1d.fbx";
				tName = "BridgeTop0M-1M";
			}
		}else if(tNode.GSDSpline.tRoad.opt_Lanes == 4){
			if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base1MOver){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-29w-5l-1d.fbx";
				tName = "BridgeTop1M-1M";
			}else if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base2MOver){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-30w-5l-1d.fbx";
				tName = "BridgeTop2M-1M";
			}else if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base3MDeep){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-28w-5l-3d.fbx";
				tName = "BridgeTop0M-3M";
			}else{
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-28w-5l-1d.fbx";
				tName = "BridgeTop0M-1M";
			}
		}else{
			if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base1MOver){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-39w-5l-1d.fbx";
				tName = "BridgeTop1M-1M";
			}else if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base2MOver){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-40w-5l-1d.fbx";
				tName = "BridgeTop2M-1M";
			}else if(tBridgeTopBaseQuickAdd == BridgeTopBaseDefaultsEnum.Base3MDeep){
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-38w-5l-3d.fbx";
				tName = "BridgeTop0M-3M";
			}else{
				tBridgeTopBaseToAdd = "Assets/RoadArchitect/Mesh/RoadObj/Bridges/BridgeBase-38w-5l-1d.fbx";
				tName = "BridgeTop0M-1M";
			}
		}
		
		if(bOverridePrefab){ tBridgeTopBaseToAdd = OverridePrefab; }
		
		SMM.tName = tName;
		SMM.CurrentSplination = (GameObject)UnityEditor.AssetDatabase.LoadAssetAtPath(tBridgeTopBaseToAdd, typeof(GameObject));
		SMM.HorizontalSep = tHorizSep;
		SMM.VerticalRaise = tVertRaise;
		SMM.bMaterialOverride = true;
		SMM.SplinatedMaterial1 = GSD.Roads.GSDRoadUtilityEditor.GiveMaterial(tMat);	
		SMM.Axis = GSD.Roads.Splination.AxisTypeEnum.Z;
		
		tBridgeTopBaseQuickAdd = BridgeTopBaseDefaultsEnum.None;
		if(SMM.StartTime < tNode.MinSplination){ SMM.StartTime = tNode.MinSplination; }
		if(SMM.EndTime > tNode.MaxSplination){ SMM.EndTime = tNode.MaxSplination; }	
	}
Ejemplo n.º 9
0
	public void UpdateSplineObjects(){
		if(!tNode.CanSplinate()){ return; }
		if(tNode.SplinatedObjects == null){ tNode.SplinatedObjects = new List<GSD.Roads.Splination.SplinatedMeshMaker>(); }
		eCount = tNode.SplinatedObjects.Count;
		for(int i=0;i<eCount;i++){	
			SMM = tNode.SplinatedObjects[i];
			if(SMM.EM != null){
				if(!SMM.EM.IsEqualToSMM(SMM)){
					SMM.EM.LoadToSMM(SMM);

					SMM.UpdatePositions();
					if(SMM.EM.bIsStretch != SMM.bIsStretch){ 
						if(SMM.bIsStretch){
							SMM.CollisionType = GSD.Roads.Splination.CollisionTypeEnum.BoxCollision;
							SMM.bMatchRoadDefinition = false;
							SMM.bMatchTerrain = false;
							SMM.bCollisionConvex = false;
							SMM.bEndDown = false;
							SMM.bVerticalCutoff = false;
							SMM.bExactSplination = false;
							SMM.bEndTypeDownOverride = false;
						}
					}
										
					SMM.Setup(true);
//					Debug.Log ("Setup SMM");
				}
			}
		}
	}
Ejemplo n.º 10
0
			public void LoadToSMM(SplinatedMeshMaker SMM){
				#if UNITY_EDITOR
				SMM.CurrentSplination = CurrentSplination; // (GameObject)UnityEditor.AssetDatabase.LoadAssetAtPath(CurrentSplinationString,typeof(GameObject));
				SMM.CurrentSplinationCap1 = CurrentSplinationCap1;// (GameObject)UnityEditor.AssetDatabase.LoadAssetAtPath(CurrentSplinationCap1String,typeof(GameObject));
				SMM.CurrentSplinationCap2 = CurrentSplinationCap2;// (GameObject)UnityEditor.AssetDatabase.LoadAssetAtPath(CurrentSplinationCap2String,typeof(GameObject));
			
				SMM.CapHeightOffset1 = CapHeightOffset1;
				SMM.CapHeightOffset2 = CapHeightOffset2;

				SMM.bMaterialOverride = bMaterialOverride;
				
				SMM.SplinatedMaterial1 = SplinatedMaterial1;
				SMM.SplinatedMaterial2 = SplinatedMaterial2;

				SMM.bExactSplination = bExactSplination;
				SMM.bMatchRoadDefinition = bMatchRoadDefinition;
				SMM.bMatchRoadIncrements = bMatchRoadIncrements;
				SMM.bTrimStart = bTrimStart;
				SMM.bTrimEnd = bTrimEnd;
				SMM.bMatchTerrain = bMatchTerrain;
				SMM.MinMaxMod = MinMaxMod;
				SMM.bIsBridge = bIsBridge;
				SMM.VertexMatchingPrecision = VertexMatchingPrecision;

				SMM.bIsStretch = bIsStretch;
				SMM.bStretchLocOffset = bStretchLocOffset;
				SMM.bStretchSize = bStretchSize;
				SMM.StretchBC_LocOffset = StretchBC_LocOffset;
				SMM.StretchBC_Size = StretchBC_Size;
				SMM.Stretch_UVThreshold = Stretch_UVThreshold;
				SMM.bStraightLineMatchStartEnd = bStraightLineMatchStartEnd;
				SMM.bBCFlipX = bBCFlipX;
				SMM.bBCFlipZ = bBCFlipZ;
				
				//Horizontal offsets:
				SMM.HorizontalSep = HorizontalSep;
				SMM.HorizontalCurve = HorizontalCurve;
				//Vertical offset:
				SMM.VerticalRaise = VerticalRaise;
				SMM.VerticalCurve = VerticalCurve;
				//Vertical cutoff:
				SMM.VerticalCutoff = VerticalCutoff;
				SMM.bVerticalCutoff = bVerticalCutoff;
				SMM.bVerticalCutoffDownwards = bVerticalCutoffDownwards;
				SMM.bVerticalMeshCutoff_OppositeDir = bVerticalMeshCutoff_OppositeDir;
				SMM.VerticalMeshCutoffOffset = VerticalMeshCutoffOffset;
				SMM.bVerticalCutoff_MatchZero = bVerticalCutoff_MatchZero;
				
				SMM.RoadRaise = RoadRaise;
				SMM.CustomRotation = CustomRotation;
				SMM.bFlipRotation = bFlipRotation;
				SMM.bStatic = bStatic;
				SMM.StartTime = StartTime;
				SMM.EndTime = EndTime;
				SMM.Axis = Axis;
				
				SMM.RepeatUVType = RepeatUVType;
				
				//Ending objects:
				SMM.EndCapStart = EndCapStart;
				SMM.EndCapEnd = EndCapEnd;

				SMM.bEndCapCustomMatchStart = bEndCapCustomMatchStart;
				SMM.EndCapCustomOffsetStart = EndCapCustomOffsetStart;
				SMM.EndCapCustomOffsetEnd = EndCapCustomOffsetEnd;
				SMM.EndCapCustomRotOffsetStart = EndCapCustomRotOffsetStart;
				SMM.EndCapCustomRotOffsetEnd = EndCapCustomRotOffsetEnd;
				SMM.bEndObjectsMatchGround = bEndObjectsMatchGround;

				//Endings down:
				SMM.bEndDown = bEndDown;
				SMM.bEndTypeDownOverride = bEndTypeDownOverride;
				SMM.EndTypeDownOverride = EndTypeDownOverride;
				
				//Collision:
				SMM.CollisionType = CollisionType;
				SMM.bCollisionConvex = bCollisionConvex;
				SMM.bSimpleCollisionAutomatic = bSimpleCollisionAutomatic;
				SMM.bCollisionTrigger = bCollisionTrigger;
				
				SMM.CollisionBoxBL = CollisionBoxBL;
				SMM.CollisionBoxBR = CollisionBoxBR;
				SMM.CollisionBoxTL = CollisionBoxTL;
				SMM.CollisionBoxTR = CollisionBoxTR;
		
				SMM.CollisionTriBL = CollisionTriBL;
				SMM.CollisionTriBR = CollisionTriBR;
				SMM.CollisionTriT = CollisionTriT;
				
				SMM.tName = tName;
				#endif
			}
Ejemplo n.º 11
0
			public void Setup(SplinatedMeshMaker SMM){
				CurrentSplination = SMM.CurrentSplination;
				CurrentSplinationCap1 = SMM.CurrentSplinationCap1;
				CurrentSplinationCap2 = SMM.CurrentSplinationCap2;
				
				CapHeightOffset1 = SMM.CapHeightOffset1;
				CapHeightOffset2 = SMM.CapHeightOffset2;

				bMaterialOverride = SMM.bMaterialOverride;
				SplinatedMaterial1 = SMM.SplinatedMaterial1;
				SplinatedMaterial2 = SMM.SplinatedMaterial2;
				bExactSplination = SMM.bExactSplination;
				bMatchRoadDefinition = SMM.bMatchRoadDefinition;
				bMatchRoadIncrements = SMM.bMatchRoadIncrements;
				bTrimStart = SMM.bTrimStart;
				bTrimEnd = SMM.bTrimEnd;
				bMatchTerrain = SMM.bMatchTerrain;
				MinMaxMod = SMM.MinMaxMod;
				bIsBridge = SMM.bIsBridge;
				VertexMatchingPrecision = SMM.VertexMatchingPrecision;
				
				bIsStretch = SMM.bIsStretch;
				bStretchLocOffset = SMM.bStretchLocOffset;
				bStretchSize = SMM.bStretchSize;
				StretchBC_LocOffset = SMM.StretchBC_LocOffset;
				StretchBC_Size = SMM.StretchBC_Size;
				Stretch_UVThreshold = SMM.Stretch_UVThreshold;
				bStraightLineMatchStartEnd = SMM.bStraightLineMatchStartEnd;
				bBCFlipX = SMM.bBCFlipX;
				bBCFlipZ = SMM.bBCFlipZ;

				//Horizontal offsets:
				HorizontalSep = SMM.HorizontalSep;
				HorizontalCurve = SMM.HorizontalCurve;
				//Vertical offset:
				VerticalRaise = SMM.VerticalRaise;
				VerticalCurve = SMM.VerticalCurve;
				//Vertical cutoff
				VerticalCutoff = SMM.VerticalCutoff;
				bVerticalCutoff = SMM.bVerticalCutoff;
				bVerticalCutoffDownwards = SMM.bVerticalCutoffDownwards;
				bVerticalMeshCutoff_OppositeDir = SMM.bVerticalMeshCutoff_OppositeDir;
				VerticalMeshCutoffOffset = SMM.VerticalMeshCutoffOffset;
				bVerticalCutoff_MatchZero = SMM.bVerticalCutoff_MatchZero;
				
				RoadRaise = SMM.RoadRaise;
				CustomRotation = SMM.CustomRotation;
				bFlipRotation = SMM.bFlipRotation;
				bStatic = SMM.bStatic;
				StartTime = SMM.StartTime;
				EndTime = SMM.EndTime;
				Axis = SMM.Axis;
				
				RepeatUVType = SMM.RepeatUVType;
				
				//End objects:
				EndCapStart = SMM.EndCapStart;
				EndCapEnd = SMM.EndCapEnd;
				
				bEndCapCustomMatchStart = SMM.bEndCapCustomMatchStart;
				EndCapCustomOffsetStart = SMM.EndCapCustomOffsetStart;
				EndCapCustomOffsetEnd = SMM.EndCapCustomOffsetEnd;
				EndCapCustomRotOffsetStart = SMM.EndCapCustomRotOffsetStart;
				EndCapCustomRotOffsetEnd = SMM.EndCapCustomRotOffsetEnd;
				bEndObjectsMatchGround = SMM.bEndObjectsMatchGround;
				//Endings down:
				bEndDown = SMM.bEndDown;
				bEndTypeDownOverride = SMM.bEndTypeDownOverride;
				EndTypeDownOverride = SMM.EndTypeDownOverride;

				//Collision:
				CollisionType = SMM.CollisionType;
				bCollisionConvex = SMM.bCollisionConvex;
				bSimpleCollisionAutomatic = SMM.bSimpleCollisionAutomatic;
				bCollisionTrigger = SMM.bCollisionTrigger;
				
				CollisionBoxBL = SMM.CollisionBoxBL;
				CollisionBoxBR = SMM.CollisionBoxBR;
				CollisionBoxTL = SMM.CollisionBoxTL;
				CollisionBoxTR = SMM.CollisionBoxTR;
		
				CollisionTriBL = SMM.CollisionTriBL;
				CollisionTriBR = SMM.CollisionTriBR;
				CollisionTriT = SMM.CollisionTriT;
				
				tName = SMM.tName;
			}
Ejemplo n.º 12
0
		public SplinatedMeshMaker Copy(){
			SplinatedMeshMaker SMM = new SplinatedMeshMaker();
			SMM.Init(tSpline,tNode,MasterObjTrans);
			SMM.MasterObjTrans = MasterObjTrans;
			SMM.bIsGSD = bIsGSD;
			
			SMM.CurrentSplination = CurrentSplination;
			SMM.CurrentSplinationString = CurrentSplinationString;
			
			SMM.CurrentSplinationCap1 = CurrentSplinationCap1;
			SMM.CurrentSplinationCap1String = CurrentSplinationCap1String;
			SMM.CurrentSplinationCap2 = CurrentSplinationCap2;
			SMM.CurrentSplinationCap2String = CurrentSplinationCap2String;
			SMM.CapHeightOffset1 = CapHeightOffset1;
			SMM.CapHeightOffset1 = CapHeightOffset2;

			SMM.Output = Output;
			SMM.tMesh = tMesh;
			SMM.bMaterialOverride = bMaterialOverride;
			SMM.SplinatedMaterial1 = SplinatedMaterial1;
			SMM.SplinatedMaterial2 = SplinatedMaterial2;
			SMM.SplinatedMaterial1String = SplinatedMaterial1String;
			SMM.SplinatedMaterial2String = SplinatedMaterial2String;
			SMM.bExactSplination = bExactSplination;
			SMM.bMatchRoadDefinition = bMatchRoadDefinition;
			SMM.bMatchRoadIncrements = bMatchRoadIncrements;
			SMM.bTrimStart = bTrimStart;
			SMM.bTrimEnd = bTrimEnd;
			SMM.bMatchTerrain = bMatchTerrain;
			SMM.MinMaxMod = MinMaxMod;
			SMM.VertexMatchingPrecision = VertexMatchingPrecision;
			
			SMM.bIsStretch = bIsStretch;
			SMM.bStretchLocOffset = bStretchLocOffset;
			SMM.bStretchSize = bStretchSize;
			SMM.StretchBC_LocOffset = StretchBC_LocOffset;
			SMM.StretchBC_Size = StretchBC_Size;
			SMM.Stretch_UVThreshold = Stretch_UVThreshold;
			SMM.bStraightLineMatchStartEnd = bStraightLineMatchStartEnd;
			SMM.bBCFlipX = bBCFlipX;
			SMM.bBCFlipZ = bBCFlipZ;

			//Horizontal offsets:
			SMM.HorizontalSep = HorizontalSep;
			SMM.HorizontalCurve = new AnimationCurve();
			if(HorizontalCurve != null && HorizontalCurve.keys.Length > 0){
				for(int i=0;i<HorizontalCurve.keys.Length;i++){
					SMM.HorizontalCurve.AddKey(HorizontalCurve.keys[i]);
				}
			}
			//Vertical offset:
			SMM.VerticalRaise = VerticalRaise;
			SMM.VerticalCurve = new AnimationCurve();
			if(VerticalCurve != null && VerticalCurve.keys.Length > 0){
				for(int i=0;i<VerticalCurve.keys.Length;i++){
					SMM.VerticalCurve.AddKey(VerticalCurve.keys[i]);
				}
			}
			
			//Vertical cutoff:
			SMM.bVerticalCutoff = bVerticalCutoff;
			SMM.VerticalCutoff = VerticalCutoff;
			SMM.bVerticalCutoffDownwards = bVerticalCutoffDownwards;
			SMM.bVerticalMeshCutoff_OppositeDir = bVerticalMeshCutoff_OppositeDir;
			SMM.VerticalMeshCutoffOffset = VerticalMeshCutoffOffset;
			SMM.bVerticalCutoff_MatchZero = bVerticalCutoff_MatchZero;

			SMM.RoadRaise = RoadRaise;
			SMM.CustomRotation = CustomRotation;
			SMM.bFlipRotation = bFlipRotation;
			SMM.bStatic = bStatic;
			SMM.StartTime = StartTime;
			SMM.EndTime = EndTime;
			SMM.StartPos = StartPos;
			SMM.EndPos = EndPos;
			SMM.Axis = Axis;
			
			SMM.RepeatUVType = RepeatUVType;
			
			SMM.mMaxX = mMaxX;
			SMM.mMinX = mMinX;
			SMM.mMaxY = mMaxY;
			SMM.mMinY = mMinY;
			SMM.mMaxZ = mMaxZ;
			SMM.mMinZ = mMinZ;
			
			//End objects:
			SMM.EndCapStart = EndCapStart;
			SMM.EndCapStartString = EndCapStartString;
			SMM.EndCapEnd = EndCapEnd;
			SMM.EndCapEndString = EndCapEndString;
			SMM.bEndCapCustomMatchStart = bEndCapCustomMatchStart;
			SMM.EndCapCustomOffsetStart = EndCapCustomOffsetStart;
			SMM.EndCapCustomOffsetEnd = EndCapCustomOffsetEnd;
			SMM.EndCapCustomRotOffsetStart = EndCapCustomRotOffsetStart;
			SMM.EndCapCustomRotOffsetEnd = EndCapCustomRotOffsetEnd;
			SMM.bEndObjectsMatchGround = bEndObjectsMatchGround;
			SMM.bIsBridge = bIsBridge;
			//End down:
			SMM.bEndDown = bEndDown;
			SMM.bEndTypeDownOverride = bEndTypeDownOverride;
			SMM.EndTypeDownOverride = EndTypeDownOverride;
			
			//Collision:
			SMM.CollisionType = CollisionType;
			SMM.bCollisionConvex = bCollisionConvex;
			SMM.bSimpleCollisionAutomatic = bSimpleCollisionAutomatic;
			SMM.bCollisionTrigger = bCollisionTrigger;
			
			SMM.CollisionBoxBL = CollisionBoxBL;
			SMM.CollisionBoxBR = CollisionBoxBR;
			SMM.CollisionBoxTL = CollisionBoxTL;
			SMM.CollisionBoxTR = CollisionBoxTR;
	
			SMM.CollisionTriBL = CollisionTriBL;
			SMM.CollisionTriBR = CollisionTriBR;
			SMM.CollisionTriT = CollisionTriT;
			
			SMM.tName = tName;
			SMM.ThumbString = ThumbString;
			SMM.Desc = Desc;	
			SMM.DisplayName = DisplayName;
			
			SMM.SetupUniqueIdentifier();
			
			return SMM;
		}
Ejemplo n.º 13
0
			public bool IsEqualToSMM(SplinatedMeshMaker SMM){
				if(SMM.CurrentSplination != CurrentSplination){ return false; } 
				if(SMM.CurrentSplinationCap1 != CurrentSplinationCap1){ return false; }
				if(SMM.CurrentSplinationCap2 != CurrentSplinationCap2){ return false; }
			
				if(!GSDRootUtil.IsApproximately(SMM.CapHeightOffset1,CapHeightOffset1,0.0001f)){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.CapHeightOffset2,CapHeightOffset2,0.0001f)){ return false; }

				if(SMM.bMaterialOverride != bMaterialOverride){ return false; }
				
				if(SMM.SplinatedMaterial1 != SplinatedMaterial1){ return false; }
				if(SMM.SplinatedMaterial2 != SplinatedMaterial2){ return false; }

				if(SMM.bExactSplination != bExactSplination){ return false; }
				if(SMM.bMatchRoadDefinition != bMatchRoadDefinition){ return false; }
				if(SMM.bMatchRoadIncrements != bMatchRoadIncrements){ return false; }
				if(SMM.bTrimStart != bTrimStart){ return false; }
				if(SMM.bTrimEnd != bTrimEnd){ return false; }
				if(SMM.bMatchTerrain != bMatchTerrain){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.MinMaxMod,MinMaxMod,0.0001f)){ return false; }
				if(SMM.bIsBridge != bIsBridge){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.VertexMatchingPrecision,VertexMatchingPrecision,0.0001f)){ return false; }

				if(SMM.bIsStretch != bIsStretch){ return false; }
				if(SMM.bStretchLocOffset != bStretchLocOffset){ return false; }
				if(SMM.bStretchSize != bStretchSize){ return false; }
				if(SMM.StretchBC_LocOffset != StretchBC_LocOffset){ return false; }
				if(SMM.StretchBC_Size != StretchBC_Size){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.Stretch_UVThreshold,Stretch_UVThreshold,0.0001f)){ return false; }
				if(SMM.bStraightLineMatchStartEnd != bStraightLineMatchStartEnd){ return false; }
				if(SMM.bBCFlipX != bBCFlipX){ return false; }
				if(SMM.bBCFlipZ != bBCFlipZ){ return false; }
				
				//Horizontal offsets:
				if(!GSDRootUtil.IsApproximately(SMM.HorizontalSep,HorizontalSep,0.0001f)){ return false; }
				if(SMM.HorizontalCurve != HorizontalCurve){ return false; }
				//Vertical offset:
				if(!GSDRootUtil.IsApproximately(SMM.VerticalRaise,VerticalRaise,0.0001f)){ return false; }
				if(SMM.VerticalCurve != VerticalCurve){ return false; }
				//Vertical cutoff:
				if(!GSDRootUtil.IsApproximately(SMM.VerticalCutoff,VerticalCutoff,0.0001f)){ return false; }
				if(SMM.bVerticalCutoff != bVerticalCutoff){ return false; }
				if(SMM.bVerticalCutoffDownwards != bVerticalCutoffDownwards){ return false; }
				if(SMM.bVerticalMeshCutoff_OppositeDir != bVerticalMeshCutoff_OppositeDir){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.VerticalMeshCutoffOffset,VerticalMeshCutoffOffset,0.0001f)){ return false; }
				if(SMM.bVerticalCutoff_MatchZero != bVerticalCutoff_MatchZero){ return false; }
				
				if(!GSDRootUtil.IsApproximately(SMM.RoadRaise,RoadRaise,0.0001f)){ return false; }
				if(SMM.CustomRotation != CustomRotation){ return false; }
				if(SMM.bFlipRotation != bFlipRotation){ return false; }
				if(SMM.bStatic != bStatic){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.StartTime,StartTime,0.0001f)){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.EndTime,EndTime,0.0001f)){ return false; }
				if(SMM.Axis != Axis){ return false; }
				
				if(SMM.RepeatUVType != RepeatUVType){ return false; }

				//Ending objects:
				if(SMM.EndCapStart != EndCapStart){ return false; }
				if(SMM.EndCapEnd != EndCapEnd){ return false; }

				if(SMM.bEndCapCustomMatchStart != bEndCapCustomMatchStart){ return false; }
				if(SMM.EndCapCustomOffsetStart != EndCapCustomOffsetStart){ return false; }
				if(SMM.EndCapCustomOffsetEnd != EndCapCustomOffsetEnd){ return false; }
				if(SMM.EndCapCustomRotOffsetStart != EndCapCustomRotOffsetStart){ return false; }
				if(SMM.EndCapCustomRotOffsetEnd != EndCapCustomRotOffsetEnd){ return false; }
				if(SMM.bEndObjectsMatchGround != bEndObjectsMatchGround){ return false; }

				//Endings down:
				if(SMM.bEndDown != bEndDown){ return false; }
				if(SMM.bEndTypeDownOverride != bEndTypeDownOverride){ return false; }
				if(!GSDRootUtil.IsApproximately(SMM.EndTypeDownOverride,EndTypeDownOverride,0.0001f)){ return false; }
				
				//Collision:
				if(SMM.CollisionType != CollisionType){ return false; }
				if(SMM.bCollisionConvex != bCollisionConvex){ return false; }
				if(SMM.bSimpleCollisionAutomatic != bSimpleCollisionAutomatic){ return false; }
				if(SMM.bCollisionTrigger != bCollisionTrigger){ return false; }
				
				if(SMM.CollisionBoxBL != CollisionBoxBL){ return false; }
				if(SMM.CollisionBoxBR != CollisionBoxBR){ return false; }
				if(SMM.CollisionBoxTL != CollisionBoxTL){ return false; }
				if(SMM.CollisionBoxTR != CollisionBoxTR){ return false; }
		
				if(SMM.CollisionTriBL != CollisionTriBL){ return false; }
				if(SMM.CollisionTriBR != CollisionTriBR){ return false; }
				if(SMM.CollisionTriT != CollisionTriT){ return false; }
				
				if(string.CompareOrdinal(SMM.tName,tName) != 0){ return false; }
				
				return true;
			}