This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Assets/ARLocation/Scripts/Utils/ShowHideSelfOnPointerClick.cs

26 lines
490 B
C#

using UnityEngine;
namespace ARLocation.Utils
{
public class ShowHideSelfOnPointerClick : MonoBehaviour
{
private Canvas canvas;
// Use this for initialization
void Start()
{
canvas = GetComponent<Canvas>();
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
canvas.enabled = !canvas.enabled;
}
}
}
}