Skip to content

Commit 5c3e4fc

Browse files
committed
small fixes
1 parent b6ce504 commit 5c3e4fc

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

Editor/EditorWindow.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public EditorWindow(double fps, int width, int height, IFileProvider fileProvide
6262
Manager.UnloadScene();
6363
Hide();
6464
};
65-
Unload += DoUnload; // right after the game loop ends
6665
}
6766

6867
protected override void OnLoad()
@@ -167,9 +166,14 @@ private void DoResize(FramebufferResizeEventArgs e)
167166
Manager.Resize(e.Width, e.Height);
168167
}
169168

170-
private void DoUnload()
169+
protected override void Dispose(bool disposing)
171170
{
172-
Manager.Dispose();
173-
Log.CloseAndFlush();
171+
if (disposing)
172+
{
173+
CursorState = CursorState.Normal;
174+
Manager.Dispose();
175+
}
176+
177+
base.Dispose(disposing);
174178
}
175179
}

Editor/Managers/InterfaceManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,11 @@ protected virtual void OnSelectionChanged(Actor? actor, ActorComponent? componen
104104
{
105105

106106
}
107+
108+
protected override void Teardown()
109+
{
110+
Deselect();
111+
112+
base.Teardown();
113+
}
107114
}

Launcher/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
provider.PostMount();
132132
provider.LoadVirtualPaths();
133133

134-
var snooper = new EditorWindow(144, 1500, 900, provider, false);
134+
using var snooper = new EditorWindow(144, 1500, 900, provider, false);
135135
var scene = new Actor("Example Scene");
136136
scene.Components.Add(new BoxComponent(Vector3.Zero, Vector3.One));
137137

Snooper/Core/Containers/Textures/Texture2D.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Texture2D(UTexture texture) : this(texture.PlatformData.SizeX, texture.Pl
2525
public override void Generate()
2626
{
2727
base.Generate();
28-
if (_owner is null or UVolumeTexture or UTextureRenderTarget)
28+
if (_owner is null or UTextureCube or UVolumeTexture or UTextureCubeArray or UTextureRenderTarget)
2929
{
3030
return;
3131
}

Snooper/Rendering/Components/Light/DirectionalLightComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public DirectionalLightComponent(UDirectionalLightComponent component) : base(co
1717
public DirectionalLightComponent(float intensity, Vector3 color, Transform? transform = null, string? name = null) : base(intensity, color, "S_LightDirectional", transform, name)
1818
{
1919
// manually placed directional lights should be at the origin, just for easy manipulation
20-
LocalTransform.Position = Vector3.Zero;
20+
// LocalTransform.Position = Vector3.Zero;
2121
}
2222

2323
protected override DebugComponent CreateDebugVisualization() => new ArrowComponent(Settings.DirectionalLight, null, $"{Name} (Direction)");

0 commit comments

Comments
 (0)