refactor
parent
fa8d7fa312
commit
12b5aacf1d
|
@ -451,9 +451,12 @@ namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
if (!canvas) return Camera.main;
|
if (!canvas) return Camera.main;
|
||||||
|
|
||||||
// World camera.
|
// Render mode is not ScreenSpaceOverlay, use world camera.
|
||||||
var root = canvas.rootCanvas;
|
var root = canvas.rootCanvas;
|
||||||
if (root.renderMode != RenderMode.ScreenSpaceOverlay) return root.worldCamera ? root.worldCamera : Camera.main;
|
if (root.renderMode != RenderMode.ScreenSpaceOverlay)
|
||||||
|
{
|
||||||
|
return root.worldCamera ? root.worldCamera : Camera.main;
|
||||||
|
}
|
||||||
|
|
||||||
// Create ortho-camera.
|
// Create ortho-camera.
|
||||||
if (!_orthoCamera)
|
if (!_orthoCamera)
|
||||||
|
|
Loading…
Reference in New Issue