Skip to content

Commit

Permalink
Rename to avoid hiding warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bnco-dev committed Aug 20, 2024
1 parent 8435355 commit 1649220
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;

namespace Ubiq.XR.Notifications
Expand All @@ -11,7 +12,7 @@ namespace Ubiq.XR.Notifications
public class PlayerNotificationsCanvas : MonoBehaviour
{
[Tooltip("The camera which will show notifications. Defaults to the camera with the MainCamera tag.")]
public Camera camera;
public Camera notificationCamera;

private Canvas canvas;
private Text messages;
Expand All @@ -35,10 +36,10 @@ void OnNotification(Notification notification)
// Start is called before the first frame update
void Start()
{
if (!camera)
if (!notificationCamera)
{
camera = Camera.main;
if (!camera)
notificationCamera = Camera.main;
if (!notificationCamera)
{
Debug.LogWarning("No Camera supplied and no camera found " +
" with the MainCamera tag in this" +
Expand All @@ -50,7 +51,7 @@ void Start()
}

canvas = GetComponentInChildren<Canvas>(includeInactive:true);
canvas.worldCamera = camera;
canvas.worldCamera = notificationCamera;
canvas.gameObject.SetActive(false);

messages = GetComponentInChildren<Text>(includeInactive:true);
Expand Down

0 comments on commit 1649220

Please sign in to comment.