Skip to content

Commit

Permalink
fix: In rare cases, the generated camera (for baking) will not be dea…
Browse files Browse the repository at this point in the history
…ctivated
  • Loading branch information
mob-sakai committed May 11, 2021
1 parent 0259ad2 commit 12c748a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Scripts/BakingCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private static BakingCamera Instance
// Find instance in scene, or create new one.
return s_Instance
? s_Instance
: (s_Instance = FindObjectOfType<BakingCamera>() ?? Create());
: (s_Instance = Create());
}
}

Expand All @@ -55,6 +55,7 @@ private static BakingCamera Create()

var inst = gameObject.AddComponent<BakingCamera>();
inst._camera = gameObject.AddComponent<Camera>();
inst._camera.enabled = false;
inst._camera.orthographic = true;

// Turn camera off because particle mesh baker will use only camera matrix
Expand Down

0 comments on commit 12c748a

Please sign in to comment.