mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-28 06:34:49 +00:00
"Version control? Track changes?" sads :c
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user