50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using Assets.Scripts;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class NewsController : PFUIPanel
|
|
{
|
|
// Start is called before the first frame update
|
|
void Awake()
|
|
{
|
|
content = transform.Find("Main").Find("Inner").Find("Content");
|
|
exit = transform.Find("Main").Find("Exit");
|
|
if (exit != null)
|
|
{
|
|
UIManager.AddEvent(exit.gameObject, EventTriggerType.PointerClick, (b) =>
|
|
{
|
|
Close();
|
|
if (App.multiNotifyContent.Count > 0)
|
|
{
|
|
transform.Find("Main").Find("Inner").Find("Content").GetComponent<Text>().text = App.multiNotifyContent.Dequeue();
|
|
Invoke("Open", 0.3f);
|
|
}
|
|
});
|
|
}
|
|
Get();
|
|
}
|
|
void Open()
|
|
{
|
|
gameObject.SetActive(true);
|
|
}
|
|
Transform content,exit;
|
|
void Get()
|
|
{
|
|
//var r = await ConfigHelper.userApi.GetNotify();
|
|
//if (r.result)
|
|
//{
|
|
// content.GetComponent<Text>().text = r.data.Value<string>("Content");
|
|
// //content.GetComponent<Text>().text
|
|
//}
|
|
content.GetComponent<Text>().text = App.notifyContent;
|
|
}
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|