Skip to content

Commit

Permalink
add isdelayed to near and far clip plane fields (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
glabute authored Jan 7, 2025
1 parent 5b2d575 commit d28cada
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions com.unity.cinemachine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- CameraDeactivated events were not sent consistently when a blend interrupted another blend before completion.
- CameraActivated events were not sent consistently when activation was due to timeline blends.

### Changed
- Added delayed processing to near and far clip plane inspector fields for the CinemachineCamera lens.


## [3.1.2] - 2024-10-01

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,18 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
var innerFovControl = foldout.AddChild(new FovPropertyControl(property, false));

var nearClip = property.FindPropertyRelative(() => s_Def.NearClipPlane);
foldout.AddChild(new PropertyField(nearClip)).RegisterValueChangeCallback((evt) =>
var nearClipField = foldout.AddChild(new PropertyField(nearClip));
nearClipField.OnInitialGeometry(() => nearClipField.SafeSetIsDelayed());
nearClipField.RegisterValueChangeCallback((evt) =>
{
if (!IsOrtho(property) && nearClip.floatValue < 0.01f)
{
nearClip.floatValue = 0.01f;
property.serializedObject.ApplyModifiedPropertiesWithoutUndo();
}
});
foldout.Add(new PropertyField(property.FindPropertyRelative(() => s_Def.FarClipPlane)));
var farClipField = foldout.AddChild(new PropertyField(property.FindPropertyRelative(() => s_Def.FarClipPlane)));
farClipField.OnInitialGeometry(() => farClipField.SafeSetIsDelayed());
foldout.Add(new PropertyField(property.FindPropertyRelative(() => s_Def.Dutch)));

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

0 comments on commit d28cada

Please sign in to comment.