Example #1
0
        public override bool BuildLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid)
        {
            grid.Process(p =>
                         p.PaintLandRegionTypeStrength(land_region_type, CalculateLandRegionTypeStrength(p.GetTerrainSample()))
                         );

            return(true);
        }
Example #2
0
 public override void PopulateLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid, GameObject parent)
 {
     grid.ProcessWithIndexs(delegate(int x, int y, LandPoint point) {
         GetLandRegionPrefabPopulaters().Process(pp =>
                                                 pp.Populate(
                                                     parent,
                                                     land.GetCellBounds(x, y),
                                                     point.GetLandRegionTypePresence(land_region_type)
                                                     )
                                                 );
     });
 }
Example #3
0
        public override void PaintLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid)
        {
            IGrid <float> overlay_tile = overlay_tile_texture.CreateGrayscaleGrid();

            grid.ProcessWithIndexs(delegate(int x, int y, LandPoint point) {
                float main_weight      = overlay_tile.GetLooped((int)(x * overlay_scale), (int)(y * overlay_scale));
                float secondary_weight = 1.0f - main_weight;

                point.PaintLandRegionSplatAlpha(land_region_type, main_splat, main_weight);
                point.PaintLandRegionSplatAlpha(land_region_type, secondary_splat, secondary_weight);
            });
        }
Example #4
0
 public override void InitilizeLandRegion(Land land, LandRegionType land_region_type)
 {
 }
Example #5
0
 public float GetLandRegionTypePresence(LandRegionType land_region_type)
 {
     return(land_region_type_presences[land_region_type].BindPercent());
 }
Example #6
0
 public float GetLandRegionTypeStrength(LandRegionType land_region_type)
 {
     return(land_region_type_strengths[land_region_type].BindPercent());
 }
Example #7
0
 public void PaintLandRegionSplatAlpha(LandRegionType land_region_type, LandRegionSplat land_region_splat, float strength = 1.0f)
 {
     land_region_splat_alpha[land_region_splat] += land_region_type_presences[land_region_type] * strength;
 }
Example #8
0
 public void PaintLandRegionTypeStrength(LandRegionType land_region_type, float strength = 1.0f)
 {
     land_region_type_strengths[land_region_type] += strength;
 }
Example #9
0
 public abstract void PaintLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid);
Example #10
0
 public abstract void InitilizeLandRegion(Land land, LandRegionType land_region_type, Palette <LandRegionSplat> palette);
Example #11
0
 public override void InitilizeLandRegion(Land land, LandRegionType land_region_type, Palette <LandRegionSplat> palette)
 {
     palette.Add(main_splat);
     palette.Add(secondary_splat);
 }
Example #12
0
 public abstract bool BuildLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid);
Example #13
0
 public abstract void InitilizeLandRegion(Land land, LandRegionType land_region_type);
Example #14
0
 public abstract void PopulateLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid, GameObject parent);
Example #15
0
 public override void PaintLandRegion(Land land, LandRegionType land_region_type, IGrid <LandPoint> grid)
 {
     grid.Process(p =>
                  GetLandRegionSplats().Process(s => p.PaintLandRegionSplatAlpha(land_region_type, s))
                  );
 }
Example #16
0
 public override void InitilizeLandRegion(Land land, LandRegionType land_region_type, Palette <LandRegionSplat> palette)
 {
     palette.AddRange(GetLandRegionSplats());
 }