Skip to content

Commit 29268d8

Browse files
authored
Merge pull request #67 from Looooong/fix-freezing-when-starting-editor
Fix freezing when starting editor
2 parents dd76484 + 27f323e commit 29268d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
- Fixed the gizmos being drawn in Game View.
2424
- Fixed camera stacking.
25+
- Fixed freezing when starting editor.
2526

2627
## [0.0.1]
2728

Runtime/Stages/Voxelizer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public Voxelizer(VXGI vxgi) {
2020
CreateCamera();
2121
CreateCameraDescriptor();
2222
CreateCameraSettings();
23-
UpdateCamera();
2423
}
2524

2625
public void Dispose() {
@@ -80,8 +79,8 @@ void CreateCamera() {
8079

8180
_camera = gameObject.AddComponent<Camera>();
8281
_camera.allowMSAA = true;
82+
_camera.aspect = 1f;
8383
_camera.orthographic = true;
84-
_camera.pixelRect = new Rect(0f, 0f, 1f, 1f);
8584
}
8685

8786
void CreateCameraDescriptor() {
@@ -112,8 +111,8 @@ void UpdateCamera() {
112111
}
113112

114113
_camera.farClipPlane = .5f * _vxgi.bound;
115-
_camera.orthographicSize = .5f * _vxgi.bound;
116114
_camera.nearClipPlane = -.5f * _vxgi.bound;
115+
_camera.orthographicSize = .5f * _vxgi.bound;
117116
_camera.transform.position = _vxgi.voxelSpaceCenter;
118117
}
119118
}

0 commit comments

Comments
 (0)