Skip to content

Commit 72d97e8

Browse files
committed
CumulusData editing
1 parent fa6dfba commit 72d97e8

File tree

2 files changed

+47
-16
lines changed

2 files changed

+47
-16
lines changed

Runtime/Planets/Shoemaker/Overrides/CloudsDataOverride.cs

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using JetBrains.Annotations;
55
using KSP.VolumeCloud;
66
using UnityEngine;
7+
using static Shoemaker.Utility.Extensions;
78

89
namespace Shoemaker.Overrides
910
{
@@ -25,23 +26,54 @@ public class CloudsDataOverride : IOverride<VolumeCloudConfiguration.CloudsData>
2526
public float? evolveSpeed;
2627
public float? topOffset;
2728
public bool? isFold;
28-
29+
public float? baseTexureTile;
30+
public float? coverageScale;
31+
public float? evanish;
32+
public float? detailAmount;
33+
public float? cloudsMaskBias;
34+
public float? upperFalloff;
35+
public float? lowerFalloff;
36+
public float? detailAltitudeShift;
37+
public bool? enableDetailTexture;
38+
public float? detailTextureTile;
39+
public float? detailStrength;
40+
public float? cloudsDensity;
41+
public float? normalScale;
42+
public Color? scaleCloudColor = Color.white;
43+
2944
public void ApplyTo(VolumeCloudConfiguration.CloudsData obj)
3045
{
31-
isEnable.Apply(value => obj.isEnable = value ?? false);
32-
castShadow.Apply(value => obj.castShadow = value ?? false);
33-
bakeCloudMipmap.Apply(value => obj.bakeCloudMipmap = value ?? 0);
34-
currentBakedCloudMipMap.Apply(value => obj.currentBakedCloudMipmap = value ?? 0);
35-
cloudsType.Apply(value => obj.cloudsType = value ?? VolumeCloudConfiguration.CloudsLayerType.Cumulus);
36-
cloudHeightRange.Apply(value => obj.cloudHeightRange = value ?? Vector2.zero);
37-
bakedCloudHeight.Apply(value => obj.bakedCloudHeight = value ?? 0);
38-
cloudsLayerRotate.Apply(value => obj.cloudsLayerRotate = value ?? Vector3.zero);
39-
enableWind.Apply(value => obj.enableWind = value ?? false);
40-
windDirection.Apply(value => obj.windDirection = value ?? Vector2.zero);
41-
movementSpeed.Apply(value => obj.movementSpeed = value ?? 0f);
42-
evolveSpeed.Apply(value => obj.evolveSpeed = value ?? 0f);
43-
topOffset.Apply(value => obj.topOffset = value ?? 0f);
44-
isFold.Apply(value => obj.isFold = value ?? false);
46+
isEnable.Apply(ref obj.isEnable);
47+
castShadow.Apply(ref obj.castShadow);
48+
bakeCloudMipmap.Apply(ref obj.bakeCloudMipmap);
49+
currentBakedCloudMipMap.Apply(ref obj.currentBakedCloudMipmap);
50+
cloudsType.Apply(ref obj.cloudsType);
51+
cloudHeightRange.Apply(ref obj.cloudHeightRange);
52+
bakedCloudHeight.Apply(ref obj.bakedCloudHeight);
53+
cloudsLayerRotate.Apply(ref obj.cloudsLayerRotate);
54+
enableWind.Apply(ref obj.enableWind);
55+
windDirection.Apply(ref obj.windDirection);
56+
movementSpeed.Apply(ref obj.movementSpeed);
57+
evolveSpeed.Apply(ref obj.evolveSpeed);
58+
topOffset.Apply(ref obj.topOffset);
59+
isFold.Apply(ref obj.isFold);
60+
if (obj is VolumeCloudConfiguration.CumulusData cumulus)
61+
{
62+
baseTexureTile.Apply(ref cumulus.baseTexureTile);
63+
coverageScale.Apply(ref cumulus.coverageScale);
64+
evanish.Apply(ref cumulus.evanish);
65+
detailAmount.Apply(ref cumulus.detailAmount);
66+
cloudsMaskBias.Apply(ref cumulus.cloudsMaskBias);
67+
upperFalloff.Apply(ref cumulus.upperFalloff);
68+
lowerFalloff.Apply(ref cumulus.lowerFalloff);
69+
detailAltitudeShift.Apply(ref cumulus.detailAltitudeShift);
70+
enableDetailTexture.Apply(ref cumulus.enableDetailTexture);
71+
detailTextureTile.Apply(ref cumulus.detailTextureTile);
72+
detailStrength.Apply(ref cumulus.detailStrength);
73+
cloudsDensity.Apply(ref cumulus.cloudsDensity);
74+
normalScale.Apply(ref cumulus.normalScale);
75+
scaleCloudColor.Apply(ref cumulus.scaleCloudColor);
76+
}
4577
}
4678
}
4779
}

Runtime/Planets/Shoemaker/Overrides/VolumeCloudConfigurationOverride.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class VolumeCloudConfigurationOverride : IOverride<VolumeCloudConfigurati
2626
public Vector2? vortexCloudHeightRange;
2727
// todo: lenticular list
2828
public List<CloudsDataOverride> cumulusList = new List<CloudsDataOverride>();
29-
// todo: cumulus list
3029
// todo: cumulus index
3130
public float? cloudCoverageModifier;
3231
public float? detailVariationRange;

0 commit comments

Comments
 (0)