Skip to content

Commit

Permalink
ConfiguratorBase: Added GetMainColor and GetSecondaryColor
Browse files Browse the repository at this point in the history
  • Loading branch information
BasmanovDaniil committed Jan 9, 2021
1 parent 2d3eb1a commit b43b6bc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Samples/Buildings/Runtime/BuildingGeneratorConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void Generate(bool randomizeConfig = true)
if (randomizeConfig)
{
GeneratePalette();
config.palette.wallColor = GetMainColorHSV().ToColor();
config.palette.wallColor = GetMainColor();
}

if (generator == null)
Expand Down
2 changes: 1 addition & 1 deletion Samples/CellularAutomata/CellularAutomatonConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void Generate()
GeneratePalette();

deadColor = GetMainColorHSV().WithSV(0.3f, 0.2f).ToColor();
aliveColor = GetMainColorHSV().ToColor();
aliveColor = GetMainColor();
}

private void DrawCells()
Expand Down
2 changes: 1 addition & 1 deletion Samples/Chairs/ChairGeneratorConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void Generate(bool randomizeConfig = true)
{
GeneratePalette();

config.color = GetMainColorHSV().ToColor();
config.color = GetMainColor();
}

var chairDraft = ChairGenerator.Chair(config);
Expand Down
10 changes: 10 additions & 0 deletions Samples/Common/ConfiguratorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,21 @@ protected ColorHSV GetMainColorHSV()
return targetPalette.mainColor;
}

protected Color GetMainColor()
{
return targetPalette.mainColor.ToColor();
}

protected ColorHSV GetSecondaryColorHSV()
{
return targetPalette.secondaryColor;
}

protected Color GetSecondaryColor()
{
return targetPalette.secondaryColor.ToColor();
}

protected void SetupSkyboxAndPalette()
{
RenderSettings.skybox = new Material(RenderSettings.skybox);
Expand Down

0 comments on commit b43b6bc

Please sign in to comment.