public void Draw() { if (start != null) { start.Draw(); } tex.Apply(); RoadMapGen.SaveTexToPng("rivers", tex); Debug.Log("finished river with " + nodeCount + " node(s), it took " + iterations + " iteration(s), children L/R: " + leftChildren + "/" + rightChildren); }
public RMGRiver(RoadMapGen map, float x, float y, int w, int h, int resize, float facing) { this.resizeFactor = resize; this.map = map; this.x = x * resizeFactor; this.y = y * resizeFactor; this.w = w * resizeFactor; this.h = h * resizeFactor; tex = new Texture2D(this.w, this.h, NYDISpriteManager.DEFAULT_TEXTURE_FORMAT, false); this.facing = facing; this.minAngle = facing - (Mathf.PI / 2.0f) - (Mathf.Deg2Rad * 10); this.maxAngle = facing + (Mathf.PI / 2.0f) + (Mathf.Deg2Rad * 10); }