mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Update symmetry counterparts when tweakables are adjusted
This commit is contained in:
parent
c4679acd49
commit
3ac20f0ddb
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:7b5be72cb4f8a55ce4459666301cd068d1e5fde8c90525585bb7ce9d4f931fd0
|
oid sha256:615f4d0433efc28fd30e7e24ade023a8eab802c1ba29bd48c4a2b963fb9c7e4b
|
||||||
size 35840
|
size 35840
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace ConformalDecals {
|
||||||
[KSPField] public Vector2 opacityRange = new Vector2(0, 1);
|
[KSPField] public Vector2 opacityRange = new Vector2(0, 1);
|
||||||
|
|
||||||
[KSPField] public bool cutoffAdjustable = true;
|
[KSPField] public bool cutoffAdjustable = true;
|
||||||
[KSPField] public float defaultCutoff = 0;
|
[KSPField] public float defaultCutoff;
|
||||||
[KSPField] public Vector2 cutoffRange = new Vector2(0, 1);
|
[KSPField] public Vector2 cutoffRange = new Vector2(0, 1);
|
||||||
|
|
||||||
[KSPField] public Rect tileRect = new Rect(-1, -1, 0, 0);
|
[KSPField] public Rect tileRect = new Rect(-1, -1, 0, 0);
|
||||||
|
@ -308,13 +308,22 @@ namespace ConformalDecals {
|
||||||
// scale or depth values have been changed, so update scale
|
// scale or depth values have been changed, so update scale
|
||||||
// and update projection matrices if attached
|
// and update projection matrices if attached
|
||||||
UpdateScale();
|
UpdateScale();
|
||||||
UpdateMaterials();
|
|
||||||
if (_isAttached) { }
|
foreach (var counterpart in part.symmetryCounterparts) {
|
||||||
|
var decal = counterpart.GetComponent<ModuleConformalDecal>();
|
||||||
|
decal.UpdateScale();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnMaterialTweakEvent(BaseField field, object obj) {
|
protected void OnMaterialTweakEvent(BaseField field, object obj) {
|
||||||
materialProperties.SetOpacity(opacity);
|
materialProperties.SetOpacity(opacity);
|
||||||
materialProperties.SetCutoff(cutoff);
|
materialProperties.SetCutoff(cutoff);
|
||||||
|
|
||||||
|
foreach (var counterpart in part.symmetryCounterparts) {
|
||||||
|
var decal = counterpart.GetComponent<ModuleConformalDecal>();
|
||||||
|
decal.materialProperties.SetOpacity(opacity);
|
||||||
|
decal.materialProperties.SetCutoff(cutoff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnVariantApplied(Part eventPart, PartVariant variant) {
|
protected void OnVariantApplied(Part eventPart, PartVariant variant) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user