先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
73 lines
2.3 KiB
C#
73 lines
2.3 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using game;
|
|
using GameCore;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Unity.Notifications;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class GiftNoticePanel : MonoBehaviour
|
|
{
|
|
Button btn_close;
|
|
Button btn_mask;
|
|
Button btn_watch1;
|
|
Button btn_watch2;
|
|
public RewardItemNew[] rewardItemNews;
|
|
private Tables _tables;
|
|
|
|
private void Awake()
|
|
{
|
|
_tables = GContext.container.Resolve<Tables>();
|
|
btn_close = transform.Find("btn_close").GetComponent<Button>();
|
|
btn_mask = transform.Find("mask").GetComponent<Button>();
|
|
btn_watch1 = transform.Find("root/btn_watch1/btn_green").GetComponent<Button>();
|
|
btn_watch2 = transform.Find("root/btn_watch2/btn_green").GetComponent<Button>();
|
|
}
|
|
private void Start()
|
|
{
|
|
btn_close.onClick.AddListener(OnClose);
|
|
btn_mask.onClick.AddListener(OnClose);
|
|
btn_watch1.onClick.AddListener(OnClickNO);
|
|
btn_watch2.onClick.AddListener(OnClickYES);
|
|
|
|
int id = GContext.container.Resolve<PlayerData>().priceLevel.DailyGiftDisplay;
|
|
Item item = _tables.TbItem.GetOrDefault(id);
|
|
var itemDataGift = GContext.container.Resolve<PlayerItemData>().GetItemDataByDropIdAndType(item.RedirectID);
|
|
//ItemDropPackage itemDropPackage = _tables.TbItemDropPackage.GetOrDefault(item.RedirectID);
|
|
//if (itemDropPackage.ItemDisplay.Count > 0)
|
|
//{
|
|
// List<string> CountDisplay = GContext.container.Resolve<PlayerItemData>().ShowItemDropPackage(id, itemDropPackage);
|
|
for (int i = 0; i < rewardItemNews.Length; i++)
|
|
{
|
|
if (i < itemDataGift.Count)
|
|
{
|
|
rewardItemNews[i].SetData(itemDataGift[i]);
|
|
}
|
|
else
|
|
{
|
|
rewardItemNews[i].transform.parent.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
//}
|
|
}
|
|
void OnClickNO()
|
|
{
|
|
//不再显示此界面
|
|
PlayerPrefs.SetInt("GiftNoticePanel", 1);
|
|
OnClose();
|
|
}
|
|
void OnClickYES()
|
|
{
|
|
//开启通知
|
|
OnClose();
|
|
GContext.container.Resolve<ILocalNotificationService>().OpenSettings();
|
|
// NotificationCenter.OpenNotificationSettings();
|
|
}
|
|
void OnClose()
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.GiftNoticePanel);
|
|
}
|
|
}
|