SelectCameraHandler.cs 420 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class SelectCameraHandler : MonoBehaviour, IPointerClickHandler
{
    public RawImage activeCamera;


    public void OnPointerClick(PointerEventData pointerEventData)
    {
        Debug.Log($"[SelectCameraHandler] Selecting camera {name}");
        activeCamera.texture = this.GetComponent<RawImage>().texture;
    }
}