powerfun-unity/Assets/Scripts/UI/Prefab/NewsController.cs

41 lines
1.0 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();
});
}
Get();
}
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()
{
}
}