Beispiel #1
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();
	}
Beispiel #2
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");
				}
			}
		}
	}