Skip to content

Commit d28cada

Browse files
authored
add isdelayed to near and far clip plane fields (#1032)
1 parent 5b2d575 commit d28cada

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

com.unity.cinemachine/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
- CameraDeactivated events were not sent consistently when a blend interrupted another blend before completion.
1111
- CameraActivated events were not sent consistently when activation was due to timeline blends.
1212

13+
### Changed
14+
- Added delayed processing to near and far clip plane inspector fields for the CinemachineCamera lens.
15+
1316

1417
## [3.1.2] - 2024-10-01
1518

com.unity.cinemachine/Editor/PropertyDrawers/LensSettingsPropertyDrawer.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,18 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
9797
var innerFovControl = foldout.AddChild(new FovPropertyControl(property, false));
9898

9999
var nearClip = property.FindPropertyRelative(() => s_Def.NearClipPlane);
100-
foldout.AddChild(new PropertyField(nearClip)).RegisterValueChangeCallback((evt) =>
100+
var nearClipField = foldout.AddChild(new PropertyField(nearClip));
101+
nearClipField.OnInitialGeometry(() => nearClipField.SafeSetIsDelayed());
102+
nearClipField.RegisterValueChangeCallback((evt) =>
101103
{
102104
if (!IsOrtho(property) && nearClip.floatValue < 0.01f)
103105
{
104106
nearClip.floatValue = 0.01f;
105107
property.serializedObject.ApplyModifiedPropertiesWithoutUndo();
106108
}
107109
});
108-
foldout.Add(new PropertyField(property.FindPropertyRelative(() => s_Def.FarClipPlane)));
110+
var farClipField = foldout.AddChild(new PropertyField(property.FindPropertyRelative(() => s_Def.FarClipPlane)));
111+
farClipField.OnInitialGeometry(() => farClipField.SafeSetIsDelayed());
109112
foldout.Add(new PropertyField(property.FindPropertyRelative(() => s_Def.Dutch)));
110113

111114
var physical = foldout.AddChild(new PropertyField(property.FindPropertyRelative(() => s_Def.PhysicalProperties)));

0 commit comments

Comments
 (0)