This commit is contained in:
yaoyanwei
2025-08-04 16:45:48 +08:00
parent 565aa16389
commit 2f2a601227
2296 changed files with 522745 additions and 93 deletions

View File

@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TcgEngine.UI
{
/// <summary>
/// Add to any UI component to make it visible or invisible based on the device
/// </summary>
public class DeviceVisibility : MonoBehaviour
{
public bool desktop = true;
public bool mobile = true;
void Start()
{
bool ismobile = GameTool.IsMobile();
if (ismobile && !mobile)
gameObject.SetActive(false);
else if (!ismobile && !desktop)
gameObject.SetActive(false);
}
}
}