mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix cloud colours
This commit is contained in:
parent
b5c7fd7e28
commit
6779a66ecf
@ -92,20 +92,29 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
cloudsBottomGO.transform.localScale = Vector3.one * (atmo.Size * 0.9f);
|
cloudsBottomGO.transform.localScale = Vector3.one * (atmo.Size * 0.9f);
|
||||||
|
|
||||||
TessellatedSphereRenderer bottomTSR = cloudsBottomGO.AddComponent<TessellatedSphereRenderer>();
|
TessellatedSphereRenderer bottomTSR = cloudsBottomGO.AddComponent<TessellatedSphereRenderer>();
|
||||||
bottomTSR.tessellationMeshGroup = GameObject.Find("CloudsBottomLayer_GD").GetComponent<TessellatedSphereRenderer>().tessellationMeshGroup;
|
bottomTSR.tessellationMeshGroup = GameObject.Find("CloudsBottomLayer_QM").GetComponent<TessellatedSphereRenderer>().tessellationMeshGroup;
|
||||||
var bottomTSRMaterials = GameObject.Find("CloudsBottomLayer_QM").GetComponent<TessellatedSphereRenderer>().sharedMaterials;
|
var bottomTSRMaterials = GameObject.Find("CloudsBottomLayer_QM").GetComponent<TessellatedSphereRenderer>().sharedMaterials;
|
||||||
var bottomTSRTempArray = new Material[bottomTSRMaterials.Length];
|
|
||||||
|
// If they set a colour apply it to all the materials else keep the default QM one
|
||||||
// It's a bit too green
|
if (atmo.CloudTint != null)
|
||||||
var bottomColor = atmo.CloudTint.ToColor32();
|
|
||||||
bottomColor.g = (byte)(bottomColor.g * 0.5f);
|
|
||||||
for (int i = 0; i < bottomTSRMaterials.Length; i++)
|
|
||||||
{
|
{
|
||||||
bottomTSRTempArray[i] = new Material(bottomTSRMaterials[i]);
|
var bottomColor = atmo.CloudTint.ToColor32();
|
||||||
bottomTSRTempArray[i].SetColor("_Color", bottomColor);
|
|
||||||
bottomTSRTempArray[i].SetColor("_TintColor", bottomColor);
|
var bottomTSRTempArray = new Material[2];
|
||||||
|
|
||||||
|
bottomTSRTempArray[0] = new Material(bottomTSRMaterials[0]);
|
||||||
|
bottomTSRTempArray[0].SetColor("_Color", bottomColor);
|
||||||
|
bottomTSRTempArray[0].SetColor("_TintColor", bottomColor);
|
||||||
|
|
||||||
|
bottomTSRTempArray[1] = new Material(bottomTSRMaterials[1]);
|
||||||
|
|
||||||
|
bottomTSR.sharedMaterials = bottomTSRTempArray;
|
||||||
}
|
}
|
||||||
bottomTSR.sharedMaterials = bottomTSRTempArray;
|
else
|
||||||
|
{
|
||||||
|
bottomTSR.sharedMaterials = bottomTSRMaterials;
|
||||||
|
}
|
||||||
|
|
||||||
bottomTSR.maxLOD = 6;
|
bottomTSR.maxLOD = 6;
|
||||||
bottomTSR.LODBias = 0;
|
bottomTSR.LODBias = 0;
|
||||||
bottomTSR.LODRadius = 1f;
|
bottomTSR.LODRadius = 1f;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user