Some checks failed
Build project / Build for (StandaloneWindows64, 6000.0.37f1) (push) Waiting to run
Build project / Publish to itch.io (StandaloneLinux64) (push) Blocked by required conditions
Build project / Publish to itch.io (StandaloneWindows64) (push) Blocked by required conditions
Build project / Build for (StandaloneLinux64, 6000.0.37f1) (push) Has been cancelled
25 lines
663 B
C#
25 lines
663 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using TMPro;
|
|
|
|
public class TabletToggle : MonoBehaviour
|
|
{
|
|
public GameObject tablet;
|
|
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.T))
|
|
{
|
|
TMP_InputField inputField = null;
|
|
if (EventSystem.current != null && EventSystem.current.currentSelectedGameObject != null)
|
|
{
|
|
inputField = EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>();
|
|
}
|
|
if (inputField != null && inputField.isFocused)
|
|
return;
|
|
|
|
tablet.SetActive(!tablet.activeSelf);
|
|
}
|
|
}
|
|
}
|