using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
|
public class GameNotice
|
{
|
static bool noticeShowed = false;
|
|
public static void OpenGameNotice()
|
{
|
#if !UNITY_EDITOR
|
try
|
{
|
var url = string.Empty;
|
if (VersionUtility.Instance.versionInfo != null)
|
{
|
url = VersionUtility.Instance.versionInfo.GetNoticeURL(VersionConfig.Get().branch);
|
}
|
|
if (!string.IsNullOrEmpty(url) && !noticeShowed)
|
{
|
SDKUtility.Instance.OpenUrl(url);
|
noticeShowed = true;
|
}
|
}
|
catch (System.Exception ex)
|
{
|
noticeShowed = true;
|
}
|
#endif
|
}
|
|
public static bool HasNotice()
|
{
|
#if !UNITY_EDITOR
|
try
|
{
|
if (VersionUtility.Instance.versionInfo!=null )
|
{
|
var url = VersionUtility.Instance.versionInfo.GetNoticeURL(VersionConfig.Get().branch);
|
return !string.IsNullOrEmpty(url);
|
}
|
else
|
{
|
return false;
|
}
|
}
|
catch (System.Exception ex)
|
{
|
return false;
|
}
|
#else
|
return false;
|
#endif
|
}
|
|
public static void OpenGameNoticeForce()
|
{
|
#if !UNITY_EDITOR
|
try
|
{
|
var url = string.Empty;
|
if (VersionUtility.Instance.versionInfo != null)
|
{
|
url = VersionUtility.Instance.versionInfo.GetNoticeURL(VersionConfig.Get().branch);
|
}
|
if (!string.IsNullOrEmpty(url))
|
{
|
SDKUtility.Instance.OpenUrl(url);
|
}
|
}
|
catch (System.Exception ex)
|
{
|
Debug.Log(ex);
|
}
|
|
#endif
|
}
|
|
}
|