File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
game/addons/tools/Code/Scene/Tools/Component Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ using Sandbox ;
2+
3+ namespace Editor ;
4+
5+ public class VolumetricFogVolumeTool : EditorTool < VolumetricFogVolume >
6+ {
7+ private IDisposable _componentUndoScope ;
8+
9+ public override void OnUpdate ( )
10+ {
11+ var volumetricFogVolume = GetSelectedComponent < VolumetricFogVolume > ( ) ;
12+ if ( volumetricFogVolume == null )
13+ return ;
14+
15+ var currentBounds = volumetricFogVolume . Bounds ;
16+
17+ using ( Gizmo . Scope ( "Volumetric Fog Volume Editor" , volumetricFogVolume . WorldTransform ) )
18+ {
19+ if ( Gizmo . Control . BoundingBox ( "Bounds" , currentBounds , out var newBounds ) )
20+ {
21+ if ( Gizmo . WasLeftMousePressed )
22+ {
23+ _componentUndoScope = SceneEditorSession . Active . UndoScope ( "Resize Volumetric Fog Volume Bounds" ) . WithComponentChanges ( volumetricFogVolume ) . Push ( ) ;
24+ }
25+ volumetricFogVolume . Bounds = newBounds ;
26+ }
27+
28+ if ( Gizmo . WasLeftMouseReleased )
29+ {
30+ _componentUndoScope ? . Dispose ( ) ;
31+ _componentUndoScope = null ;
32+ }
33+ }
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments