예제 #1
0
		public ContourSegment GenerateSection(Contour terrain, Vector2 startPoint, float dist, float length, float slope, bool bumpify) {
			ContourSegmentConfig config = new ContourSegmentConfig();
			config.startPoint = startPoint;
			config.length = length;
			config.slope = slope;
			config.distStart = dist;
			config.bumpify = bumpify;
			return GenerateSection(terrain, config);
		}
예제 #2
0
		public void Initialize(Contour terrain, ContourSegmentConfig config, ContourSegmentAttributes attributes) {
			this.terrain = terrain;
			this.config = config;
			this.attributes = attributes;

			transform.parent = terrain.transform;
			transform.localPosition = Vector2.zero;

			CalculateSlopeVector();
			CalculatePerpendicularSlopeVector();
			GenerateEndPoint();
			GenerateMidPoints();
	//		BumpifyMidPointsIfNeeded();
			CollectAllPointsInList();
			CalculateSurfaceMeasures();
			CalculateDistAtEnd();
		}
예제 #3
0
		private ContourSegment GenerateSection(Contour terrain, ContourSegmentConfig config) {
			ContourSegment section = new GameObject("Section", typeof(ContourSegment)).GetComponent<ContourSegment>();
			section.Initialize(terrain, config, attributes);
			return section;
		}