Forest_Client/Forest/Assets/Scripts/Gameplay/Debug/SROptions.Notification.cs

27 lines
819 B
C#
Raw Normal View History

2024-07-16 15:19:52 +08:00
using System.ComponentModel;
using System;
using Gameplay.Manager;
public partial class SROptions
{
[Category("通知相关"), DisplayName("通知id")]
public int NotificationID { get; set; }
[Category("通知相关"), DisplayName("发送通知")]
public void SendNotification()
{
#if UNITY_ANDROID
int id = Notification.Android.SetNotification("通知", "测试通知", DateTime.UtcNow.AddSeconds(5f), "small", "large", "测试", true);
DebugUtil.Log($"发送安卓测试通知,通知id{id}");
#endif
}
[Category("通知相关"), DisplayName("取消指定id通知")]
public void CancelNotification()
{
#if UNITY_ANDROID
Notification.Android.CancelNotification(1);
DebugUtil.Log($"取消安卓测试通知,通知id{NotificationID}");
#endif
}
}