mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-28 06:15:42 +00:00
32 lines
742 B
C#
32 lines
742 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UniRx;
|
|
using UniRx.Triggers;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.Serialization;
|
|
|
|
public class ClickEventDebugger : MonoBehaviour
|
|
{
|
|
[FormerlySerializedAs("text")] public TMPro.TMP_Text TMP_text;
|
|
|
|
void LateUpdate()
|
|
{
|
|
EventSystem eventSystem = EventSystem.current;
|
|
|
|
var obj = eventSystem.currentSelectedGameObject;
|
|
// if (obj is null) // this does NOT catch 'obj is missing reference'; only null.
|
|
// {
|
|
// return;
|
|
// }
|
|
if (!obj) //this catches 'missing reference '
|
|
{
|
|
return;
|
|
}
|
|
|
|
TMP_text.text = obj.name;
|
|
}
|
|
|
|
}
|