Skip to content

Commit

Permalink
Merge pull request #25 from kou-yeung/feature/#23
Browse files Browse the repository at this point in the history
use camera when rendermode is not  screenspace overlay and have camera is setted
  • Loading branch information
kou-yeung authored Jul 19, 2019
2 parents 5e92da5 + 5e3251d commit a5fd3e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Assets/WebGLSupport/WebGLInput/WebGLInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ Rect GetScreenCoordinates(RectTransform uiElement)

// try to support RenderMode:WorldSpace
var canvas = uiElement.GetComponentInParent<Canvas>();
if (canvas && canvas.worldCamera != null)
var hasCamera = (canvas.renderMode != RenderMode.ScreenSpaceOverlay) && (canvas.worldCamera != null);
if (canvas && hasCamera )
{
for (var i = 0; i < worldCorners.Length; i++)
{
Expand Down

0 comments on commit a5fd3e7

Please sign in to comment.