mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
make color good
This commit is contained in:
parent
71874669c9
commit
64f81f9dca
@ -24,7 +24,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
meshRenderer.material.SetFloat(InnerRadius, atmosphereModule.clouds != null ? atmosphereModule.size : surfaceSize);
|
meshRenderer.material.SetFloat(InnerRadius, atmosphereModule.clouds != null ? atmosphereModule.size : surfaceSize);
|
||||||
meshRenderer.material.SetFloat(OuterRadius, atmosphereModule.size * 1.2f);
|
meshRenderer.material.SetFloat(OuterRadius, atmosphereModule.size * 1.2f);
|
||||||
if (atmosphereModule.atmosphereTint != null)
|
if (atmosphereModule.atmosphereTint != null)
|
||||||
meshRenderer.material.SetColor(SkyColor, atmosphereModule.atmosphereTint.ToColor());
|
meshRenderer.material.SetColor(SkyColor, atmosphereModule.atmosphereTint);
|
||||||
}
|
}
|
||||||
|
|
||||||
atmo.SetActive(true);
|
atmo.SetActive(true);
|
||||||
|
|||||||
@ -39,7 +39,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
// If they set a colour apply it to all the materials else keep the default QM one
|
// If they set a colour apply it to all the materials else keep the default QM one
|
||||||
if (atmo.clouds.tint != null)
|
if (atmo.clouds.tint != null)
|
||||||
{
|
{
|
||||||
var bottomColor = atmo.clouds.tint.ToColor();
|
var bottomColor = atmo.clouds.tint;
|
||||||
|
|
||||||
var bottomTSRTempArray = new Material[2];
|
var bottomTSRTempArray = new Material[2];
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
for(int i = 0; i < atmo.clouds.lightningGradient.Length; i++)
|
for(int i = 0; i < atmo.clouds.lightningGradient.Length; i++)
|
||||||
{
|
{
|
||||||
var pair = atmo.clouds.lightningGradient[i];
|
var pair = atmo.clouds.lightningGradient[i];
|
||||||
gradient[i] = new GradientColorKey(pair.Tint.ToColor(), pair.Time);
|
gradient[i] = new GradientColorKey(pair.Tint, pair.Time);
|
||||||
}
|
}
|
||||||
|
|
||||||
lightningGenerator._lightColor.colorKeys = gradient;
|
lightningGenerator._lightColor.colorKeys = gradient;
|
||||||
@ -138,7 +138,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
|
|
||||||
public static GameObject MakeTopClouds(GameObject rootObject, AtmosphereModule atmo, IModBehaviour mod)
|
public static GameObject MakeTopClouds(GameObject rootObject, AtmosphereModule atmo, IModBehaviour mod)
|
||||||
{
|
{
|
||||||
Color cloudTint = atmo.clouds.tint?.ToColor() ?? Color.white;
|
Color cloudTint = atmo.clouds.tint ?? Color.white;
|
||||||
|
|
||||||
Texture2D image, cap, ramp;
|
Texture2D image, cap, ramp;
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
PFC.fogExponent = 1f;
|
PFC.fogExponent = 1f;
|
||||||
PFC.fogColorRampTexture = dbPlanetaryFogController.fogColorRampTexture;
|
PFC.fogColorRampTexture = dbPlanetaryFogController.fogColorRampTexture;
|
||||||
PFC.fogColorRampIntensity = 1f;
|
PFC.fogColorRampIntensity = 1f;
|
||||||
PFC.fogTint = atmo.fogTint.ToColor();
|
PFC.fogTint = atmo.fogTint;
|
||||||
|
|
||||||
GameObject lodFogGO = new GameObject("LODFogSphere");
|
GameObject lodFogGO = new GameObject("LODFogSphere");
|
||||||
lodFogGO.SetActive(false);
|
lodFogGO.SetActive(false);
|
||||||
@ -42,7 +42,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
|
|
||||||
MeshRenderer lodMR = lodFogGO.AddComponent<MeshRenderer>();
|
MeshRenderer lodMR = lodFogGO.AddComponent<MeshRenderer>();
|
||||||
lodMR.material = new Material(brambleLODFog.GetComponent<MeshRenderer>().material);
|
lodMR.material = new Material(brambleLODFog.GetComponent<MeshRenderer>().material);
|
||||||
lodMR.material.color = atmo.fogTint.ToColor();
|
lodMR.material.color = atmo.fogTint;
|
||||||
lodMR.material.renderQueue = 1000;
|
lodMR.material.renderQueue = 1000;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -44,7 +44,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
var cloudMaterial = new Material(gdRuleset._cloudMaterial);
|
var cloudMaterial = new Material(gdRuleset._cloudMaterial);
|
||||||
if (config.Atmosphere?.clouds?.tint != null)
|
if (config.Atmosphere?.clouds?.tint != null)
|
||||||
{
|
{
|
||||||
cloudMaterial.SetColor(FogColor, config.Atmosphere.clouds.tint.ToColor32());
|
cloudMaterial.SetColor(FogColor, config.Atmosphere.clouds.tint);
|
||||||
}
|
}
|
||||||
ER._cloudMaterial = cloudMaterial;
|
ER._cloudMaterial = cloudMaterial;
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
materials[i] = new Material(waterMaterials[i]);
|
materials[i] = new Material(waterMaterials[i]);
|
||||||
if (module.tint != null)
|
if (module.tint != null)
|
||||||
{
|
{
|
||||||
materials[i].SetColor(FogColor, module.tint.ToColor());
|
materials[i].SetColor(FogColor, module.tint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (module.tint != null)
|
if (module.tint != null)
|
||||||
{
|
{
|
||||||
lavaMaterial.SetColor(EmissionColor, module.tint.ToColor());
|
lavaMaterial.SetColor(EmissionColor, module.tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyGO.GetComponentInChildren<MeshRenderer>().material = lavaMaterial;
|
proxyGO.GetComponentInChildren<MeshRenderer>().material = lavaMaterial;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
lavaSphere.transform.localScale = Vector3.one;
|
lavaSphere.transform.localScale = Vector3.one;
|
||||||
lavaSphere.transform.name = "LavaSphere";
|
lavaSphere.transform.name = "LavaSphere";
|
||||||
lavaSphere.GetComponent<MeshRenderer>().material.SetFloat(HeightScale, heightScale);
|
lavaSphere.GetComponent<MeshRenderer>().material.SetFloat(HeightScale, heightScale);
|
||||||
if (module.tint != null) lavaSphere.GetComponent<MeshRenderer>().material.SetColor(EmissionColor, module.tint.ToColor());
|
if (module.tint != null) lavaSphere.GetComponent<MeshRenderer>().material.SetColor(EmissionColor, module.tint);
|
||||||
|
|
||||||
var sectorCullGroup = lavaSphere.GetComponent<SectorCullGroup>();
|
var sectorCullGroup = lavaSphere.GetComponent<SectorCullGroup>();
|
||||||
sectorCullGroup.SetSector(sector);
|
sectorCullGroup.SetSector(sector);
|
||||||
@ -44,7 +44,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
proxyLavaSphere.transform.localScale = Vector3.one;
|
proxyLavaSphere.transform.localScale = Vector3.one;
|
||||||
proxyLavaSphere.name = "LavaSphere_Proxy";
|
proxyLavaSphere.name = "LavaSphere_Proxy";
|
||||||
proxyLavaSphere.GetComponent<MeshRenderer>().material.SetFloat(HeightScale, heightScale);
|
proxyLavaSphere.GetComponent<MeshRenderer>().material.SetFloat(HeightScale, heightScale);
|
||||||
if (module.tint != null) proxyLavaSphere.GetComponent<MeshRenderer>().material.SetColor(EmissionColor, module.tint.ToColor());
|
if (module.tint != null) proxyLavaSphere.GetComponent<MeshRenderer>().material.SetColor(EmissionColor, module.tint);
|
||||||
|
|
||||||
var sectorProxy = moltenCoreProxy.GetComponent<SectorProxy>();
|
var sectorProxy = moltenCoreProxy.GetComponent<SectorProxy>();
|
||||||
sectorProxy._renderers = new List<Renderer> { proxyLavaSphere.GetComponent<MeshRenderer>() };
|
sectorProxy._renderers = new List<Renderer> { proxyLavaSphere.GetComponent<MeshRenderer>() };
|
||||||
|
|||||||
@ -27,7 +27,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
var cubeSphereMR = icosphere.AddComponent<MeshRenderer>();
|
var cubeSphereMR = icosphere.AddComponent<MeshRenderer>();
|
||||||
cubeSphereMR.material = new Material(Shader.Find("Standard"));
|
cubeSphereMR.material = new Material(Shader.Find("Standard"));
|
||||||
cubeSphereMR.material.color = module.color != null ? module.color.ToColor() : Color.white;
|
cubeSphereMR.material.color = module.color != null ? module.color : Color.white;
|
||||||
|
|
||||||
var cubeSphereMC = icosphere.AddComponent<MeshCollider>();
|
var cubeSphereMC = icosphere.AddComponent<MeshCollider>();
|
||||||
cubeSphereMC.sharedMesh = mesh;
|
cubeSphereMC.sharedMesh = mesh;
|
||||||
|
|||||||
@ -77,18 +77,18 @@ namespace NewHorizons.Builder.Body
|
|||||||
if (realSize < body.Config.Lava.size) realSize = body.Config.Lava.size;
|
if (realSize < body.Config.Lava.size) realSize = body.Config.Lava.size;
|
||||||
|
|
||||||
var material = new Material(lavaMaterial);
|
var material = new Material(lavaMaterial);
|
||||||
if (body.Config.Lava.tint != null) material.SetColor(EmissionColor, body.Config.Lava.tint.ToColor());
|
if (body.Config.Lava.tint != null) material.SetColor(EmissionColor, body.Config.Lava.tint);
|
||||||
sphere.GetComponent<MeshRenderer>().material = material;
|
sphere.GetComponent<MeshRenderer>().material = material;
|
||||||
}
|
}
|
||||||
if (body.Config.Water != null)
|
if (body.Config.Water != null)
|
||||||
{
|
{
|
||||||
var colour = body.Config.Water.tint?.ToColor() ?? Color.blue;
|
var colour = body.Config.Water.tint ?? Color.blue;
|
||||||
AddColouredSphere(newProxy, body.Config.Water.size, body.Config.Water.Curve, colour);
|
AddColouredSphere(newProxy, body.Config.Water.size, body.Config.Water.Curve, colour);
|
||||||
if (realSize < body.Config.Water.size) realSize = body.Config.Water.size;
|
if (realSize < body.Config.Water.size) realSize = body.Config.Water.size;
|
||||||
}
|
}
|
||||||
if (body.Config.Sand != null)
|
if (body.Config.Sand != null)
|
||||||
{
|
{
|
||||||
var colour = body.Config.Sand.Tint?.ToColor() ?? Color.yellow;
|
var colour = body.Config.Sand.Tint ?? Color.yellow;
|
||||||
AddColouredSphere(newProxy, body.Config.Sand.Size, body.Config.Sand.Curve, colour);
|
AddColouredSphere(newProxy, body.Config.Sand.Size, body.Config.Sand.Curve, colour);
|
||||||
if (realSize < body.Config.Sand.Size) realSize = body.Config.Sand.Size;
|
if (realSize < body.Config.Sand.Size) realSize = body.Config.Sand.Size;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,8 +24,8 @@ namespace NewHorizons.Builder.Body
|
|||||||
new Material(sandMaterials[1])
|
new Material(sandMaterials[1])
|
||||||
};
|
};
|
||||||
GameObject.Destroy(oldMR);
|
GameObject.Destroy(oldMR);
|
||||||
sandMR.sharedMaterials[0].color = module.Tint.ToColor32();
|
sandMR.sharedMaterials[0].color = module.Tint;
|
||||||
sandMR.sharedMaterials[1].color = module.Tint.ToColor32();
|
sandMR.sharedMaterials[1].color = module.Tint;
|
||||||
}
|
}
|
||||||
|
|
||||||
var collider = GameObject.Instantiate(GameObject.Find("TowerTwin_Body/SandSphere_Draining/Collider"), sandGO.transform);
|
var collider = GameObject.Instantiate(GameObject.Find("TowerTwin_Body/SandSphere_Draining/Collider"), sandGO.transform);
|
||||||
|
|||||||
@ -42,13 +42,13 @@ namespace NewHorizons.Builder.Body
|
|||||||
PlanetaryFogController fog = sunAtmosphere.transform.Find("FogSphere").GetComponent<PlanetaryFogController>();
|
PlanetaryFogController fog = sunAtmosphere.transform.Find("FogSphere").GetComponent<PlanetaryFogController>();
|
||||||
if (starModule.tint != null)
|
if (starModule.tint != null)
|
||||||
{
|
{
|
||||||
fog.fogTint = starModule.tint.ToColor();
|
fog.fogTint = starModule.tint;
|
||||||
sunAtmosphere.transform.Find("AtmoSphere").transform.localScale = Vector3.one;
|
sunAtmosphere.transform.Find("AtmoSphere").transform.localScale = Vector3.one;
|
||||||
foreach (var lod in sunAtmosphere.transform.Find("AtmoSphere").GetComponentsInChildren<MeshRenderer>())
|
foreach (var lod in sunAtmosphere.transform.Find("AtmoSphere").GetComponentsInChildren<MeshRenderer>())
|
||||||
{
|
{
|
||||||
lod.material.SetColor(SkyColor, starModule.tint.ToColor());
|
lod.material.SetColor(SkyColor, starModule.tint);
|
||||||
lod.material.SetColor(AtmosFar, starModule.tint.ToColor());
|
lod.material.SetColor(AtmosFar, starModule.tint);
|
||||||
lod.material.SetColor(AtmosNear, starModule.tint.ToColor());
|
lod.material.SetColor(AtmosNear, starModule.tint);
|
||||||
lod.material.SetFloat(InnerRadius, starModule.size);
|
lod.material.SetFloat(InnerRadius, starModule.size);
|
||||||
lod.material.SetFloat(OuterRadius, starModule.size * OuterRadiusRatio);
|
lod.material.SetFloat(OuterRadius, starModule.size * OuterRadiusRatio);
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
light.range *= Mathf.Sqrt(starModule.solarLuminosity);
|
light.range *= Mathf.Sqrt(starModule.solarLuminosity);
|
||||||
|
|
||||||
Color lightColour = light.color;
|
Color lightColour = light.color;
|
||||||
if (starModule.lightTint != null) lightColour = starModule.lightTint.ToColor();
|
if (starModule.lightTint != null) lightColour = starModule.lightTint;
|
||||||
|
|
||||||
light.color = lightColour;
|
light.color = lightColour;
|
||||||
ambientLight.color = lightColour;
|
ambientLight.color = lightColour;
|
||||||
@ -177,7 +177,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (starModule.tint != null)
|
if (starModule.tint != null)
|
||||||
{
|
{
|
||||||
var flareTint = starModule.tint.ToColor();
|
var flareTint = starModule.tint;
|
||||||
var emitter = solarFlareEmitter.GetComponent<SolarFlareEmitter>();
|
var emitter = solarFlareEmitter.GetComponent<SolarFlareEmitter>();
|
||||||
emitter.tint = flareTint;
|
emitter.tint = flareTint;
|
||||||
foreach (var controller in solarFlareEmitter.GetComponentsInChildren<SolarFlareController>())
|
foreach (var controller in solarFlareEmitter.GetComponentsInChildren<SolarFlareController>())
|
||||||
@ -195,7 +195,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
{
|
{
|
||||||
TessellatedSphereRenderer surface = sunSurface.GetComponent<TessellatedSphereRenderer>();
|
TessellatedSphereRenderer surface = sunSurface.GetComponent<TessellatedSphereRenderer>();
|
||||||
|
|
||||||
var colour = starModule.tint.ToColor();
|
var colour = starModule.tint;
|
||||||
|
|
||||||
var sun = GameObject.Find("Sun_Body");
|
var sun = GameObject.Find("Sun_Body");
|
||||||
var mainSequenceMaterial = sun.GetComponent<SunController>().GetValue<Material>("_startSurfaceMaterial");
|
var mainSequenceMaterial = sun.GetComponent<SunController>().GetValue<Material>("_startSurfaceMaterial");
|
||||||
@ -211,7 +211,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (starModule.endTint != null)
|
if (starModule.endTint != null)
|
||||||
{
|
{
|
||||||
var endColour = starModule.endTint.ToColor();
|
var endColour = starModule.endTint;
|
||||||
darkenedColor = new Color(endColour.r * mod, endColour.g * mod, endColour.b * mod);
|
darkenedColor = new Color(endColour.r * mod, endColour.g * mod, endColour.b * mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (starModule.supernovaTint != null)
|
if (starModule.supernovaTint != null)
|
||||||
{
|
{
|
||||||
var colour = starModule.supernovaTint.ToColor();
|
var colour = starModule.supernovaTint;
|
||||||
|
|
||||||
var supernovaMaterial = new Material(supernova._supernovaMaterial);
|
var supernovaMaterial = new Material(supernova._supernovaMaterial);
|
||||||
var ramp = ImageUtilities.LerpGreyscaleImage(ImageUtilities.GetTexture(Main.Instance, "AssetBundle/Effects_SUN_Supernova_d.png"), Color.white, colour);
|
var ramp = ImageUtilities.LerpGreyscaleImage(ImageUtilities.GetTexture(Main.Instance, "AssetBundle/Effects_SUN_Supernova_d.png"), Color.white, colour);
|
||||||
|
|||||||
@ -40,8 +40,8 @@ namespace NewHorizons.Builder.Body
|
|||||||
tempArray[i] = new Material(GDSharedMaterials[i]);
|
tempArray[i] = new Material(GDSharedMaterials[i]);
|
||||||
if (module.tint != null)
|
if (module.tint != null)
|
||||||
{
|
{
|
||||||
tempArray[i].color = module.tint.ToColor();
|
tempArray[i].color = module.tint;
|
||||||
tempArray[i].SetColor("_FogColor", module.tint.ToColor());
|
tempArray[i].SetColor("_FogColor", module.tint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (module.tint != null)
|
if (module.tint != null)
|
||||||
{
|
{
|
||||||
var adjustedColour = module.tint.ToColor() / 4f;
|
var adjustedColour = (Color)module.tint / 4f;
|
||||||
adjustedColour.a = adjustedColour.a * 4f;
|
adjustedColour.a = adjustedColour.a * 4f;
|
||||||
fogGO.GetComponent<MeshRenderer>().material.color = adjustedColour;
|
fogGO.GetComponent<MeshRenderer>().material.color = adjustedColour;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,13 +57,13 @@ namespace NewHorizons.Builder.Orbital
|
|||||||
}
|
}
|
||||||
|
|
||||||
var color = Color.white;
|
var color = Color.white;
|
||||||
if (config.Orbit.Tint != null) color = config.Orbit.Tint.ToColor32();
|
if (config.Orbit.Tint != null) color = config.Orbit.Tint;
|
||||||
else if (config.Star != null) color = config.Star.tint.ToColor32();
|
else if (config.Star != null) color = config.Star.tint;
|
||||||
else if (config.Atmosphere?.clouds?.tint != null) color = config.Atmosphere.clouds.tint.ToColor32();
|
else if (config.Atmosphere?.clouds?.tint != null) color = config.Atmosphere.clouds.tint;
|
||||||
else if (config.Singularity != null) color = new Color(1f, 0.5f, 1f);
|
else if (config.Singularity != null) color = new Color(1f, 0.5f, 1f);
|
||||||
else if (config.Water != null) color = new Color(0.5f, 0.5f, 1f);
|
else if (config.Water != null) color = new Color(0.5f, 0.5f, 1f);
|
||||||
else if (config.Lava != null) color = new Color(1f, 0.5f, 0.5f);
|
else if (config.Lava != null) color = new Color(1f, 0.5f, 0.5f);
|
||||||
else if (config.Atmosphere != null && config.Atmosphere.fogTint != null) color = config.Atmosphere.fogTint.ToColor32();
|
else if (config.Atmosphere != null && config.Atmosphere.fogTint != null) color = config.Atmosphere.fogTint;
|
||||||
|
|
||||||
var fade = isMoon;
|
var fade = isMoon;
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
var ambientLight = new SlideAmbientLightModule();
|
var ambientLight = new SlideAmbientLightModule();
|
||||||
ambientLight._intensity = slideInfo.ambientLightIntensity;
|
ambientLight._intensity = slideInfo.ambientLightIntensity;
|
||||||
ambientLight._range = slideInfo.ambientLightRange;
|
ambientLight._range = slideInfo.ambientLightRange;
|
||||||
ambientLight._color = slideInfo.ambientLightColor.ToColor();
|
ambientLight._color = slideInfo.ambientLightColor;
|
||||||
ambientLight._spotIntensityMod = slideInfo.spotIntensityMod;
|
ambientLight._spotIntensityMod = slideInfo.spotIntensityMod;
|
||||||
modules.Add(ambientLight);
|
modules.Add(ambientLight);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,7 +148,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
if (info.tint != null)
|
if (info.tint != null)
|
||||||
{
|
{
|
||||||
ApplyTint(tornadoGO, info.tint.ToColor(), false, downwards);
|
ApplyTint(tornadoGO, info.tint, false, downwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.wanderRate != 0)
|
if (info.wanderRate != 0)
|
||||||
@ -205,7 +205,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
if (info.tint != null)
|
if (info.tint != null)
|
||||||
{
|
{
|
||||||
ApplyTint(hurricaneGO, info.tint.ToColor(), true, false);
|
ApplyTint(hurricaneGO, info.tint, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.wanderRate != 0)
|
if (info.wanderRate != 0)
|
||||||
|
|||||||
@ -50,8 +50,8 @@ namespace NewHorizons.Builder.Props
|
|||||||
meteor.transform.localScale = Vector3.one * info.scale;
|
meteor.transform.localScale = Vector3.one * info.scale;
|
||||||
|
|
||||||
var mat = meteor.GetComponentInChildren<MeshRenderer>().material;
|
var mat = meteor.GetComponentInChildren<MeshRenderer>().material;
|
||||||
mat.SetColor(Color1, info.stoneTint?.ToColor() ?? defaultStoneTint);
|
mat.SetColor(Color1, info.stoneTint ?? defaultStoneTint);
|
||||||
mat.SetColor(EmissionColor, info.lavaTint?.ToColor() ?? defaultLavaTint);
|
mat.SetColor(EmissionColor, info.lavaTint ?? defaultLavaTint);
|
||||||
|
|
||||||
var detectors = meteor.transform.Find("ConstantDetectors").gameObject;
|
var detectors = meteor.transform.Find("ConstantDetectors").gameObject;
|
||||||
GameObject.Destroy(detectors.GetComponent<ConstantForceDetector>());
|
GameObject.Destroy(detectors.GetComponent<ConstantForceDetector>());
|
||||||
|
|||||||
@ -521,10 +521,10 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
}
|
}
|
||||||
|
|
||||||
var starColor = body.Config?.Star?.tint;
|
var starColor = body.Config?.Star?.tint;
|
||||||
if (starColor != null) return starColor.ToColor();
|
if (starColor != null) return starColor;
|
||||||
|
|
||||||
var atmoColor = body.Config.Atmosphere?.atmosphereTint;
|
var atmoColor = body.Config.Atmosphere?.atmosphereTint;
|
||||||
if (body.Config.Atmosphere?.clouds != null && atmoColor != null) return atmoColor.ToColor();
|
if (body.Config.Atmosphere?.clouds != null && atmoColor != null) return atmoColor;
|
||||||
|
|
||||||
if (body.Config?.HeightMap?.textureMap != null)
|
if (body.Config?.HeightMap?.textureMap != null)
|
||||||
{
|
{
|
||||||
@ -538,13 +538,13 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
}
|
}
|
||||||
|
|
||||||
var waterColor = body.Config.Water?.tint;
|
var waterColor = body.Config.Water?.tint;
|
||||||
if (waterColor != null) return waterColor.ToColor();
|
if (waterColor != null) return waterColor;
|
||||||
|
|
||||||
var lavaColor = body.Config.Lava?.tint;
|
var lavaColor = body.Config.Lava?.tint;
|
||||||
if (lavaColor != null) return lavaColor.ToColor();
|
if (lavaColor != null) return lavaColor;
|
||||||
|
|
||||||
var sandColor = body.Config.Sand?.Tint;
|
var sandColor = body.Config.Sand?.Tint;
|
||||||
if (sandColor != null) return sandColor.ToColor();
|
if (sandColor != null) return sandColor;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -31,8 +31,8 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
{
|
{
|
||||||
CuriosityName newName = (CuriosityName)8 + _rawNameToCuriosityName.Count;
|
CuriosityName newName = (CuriosityName)8 + _rawNameToCuriosityName.Count;
|
||||||
_rawNameToCuriosityName.Add(newColor.id, newName);
|
_rawNameToCuriosityName.Add(newColor.id, newName);
|
||||||
_curiosityColors.Add(newName, newColor.color.ToColor());
|
_curiosityColors.Add(newName, newColor.color);
|
||||||
_curiosityHighlightColors.Add(newName, newColor.highlightColor.ToColor());
|
_curiosityHighlightColors.Add(newName, newColor.highlightColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_startColour = startColour.ToColor();
|
_startColour = startColour;
|
||||||
_startSurfaceMaterial.color = _startColour;
|
_startSurfaceMaterial.color = _startColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_endColour = endColour.ToColor();
|
_endColour = endColour;
|
||||||
_endSurfaceMaterial.color = _endColour;
|
_endSurfaceMaterial.color = _endColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,6 @@ namespace NewHorizons.Utility
|
|||||||
[System.ComponentModel.DataAnnotations.Range(0f, int.MaxValue)]
|
[System.ComponentModel.DataAnnotations.Range(0f, int.MaxValue)]
|
||||||
public int a;
|
public int a;
|
||||||
|
|
||||||
public Color32 ToColor32() => new Color32((byte)r, (byte)g, (byte)b, (byte)a);
|
public static implicit operator Color(MColor c) => new Color(c.r / 255f, c.g / 255f, c.b / 255f, c.a / 255f);
|
||||||
|
|
||||||
public Color ToColor() => new Color(r / 255f, g / 255f, b / 255f, a / 255f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user