init
This commit is contained in:
25
Assets/TcgEngine/Scripts/Tools/DeviceVisibility.cs
Normal file
25
Assets/TcgEngine/Scripts/Tools/DeviceVisibility.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user