_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/LqUiScripts/InviteFriendsPanel.cs

50 lines
1.3 KiB
C#
Raw Normal View History

2024-11-25 22:18:57 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
2024-11-27 10:41:18 +08:00
using TMPro;
2024-11-25 22:18:57 +08:00
public class InviteFriendsPanel : MonoBehaviour
{
public Button inviteBtn;
public GameObject invitefriendPanel;
public GameObject personalcenterPanel;
2024-11-27 10:41:18 +08:00
public TextMeshProUGUI nameText;
public Text numText;//<2F><><EFBFBD><EFBFBD>
public queryInviteHigherInfo61 queryInviteHigherInfo61=new queryInviteHigherInfo61();
public InviteHigherInfo inviteHigherInfo=new InviteHigherInfo();
2024-11-25 22:18:57 +08:00
// Start is called before the first frame update
2024-11-27 10:41:18 +08:00
async void Start()
2024-11-25 22:18:57 +08:00
{
2024-11-27 10:41:18 +08:00
inviteHigherInfo=await queryInviteHigherInfo61.queryInviteHigherInfo();
SetInfo();
2024-11-25 22:18:57 +08:00
}
2024-11-27 10:41:18 +08:00
public void SetInfo()
{
if (inviteHigherInfo.data!=null)
{
nameText.text=inviteHigherInfo.data.nickName;
}
numText.text = invitefriendPanel.GetComponent<FriendPanel>().friendInfos.Count.ToString();
}
2024-11-25 22:18:57 +08:00
// Update is called once per frame
void Update()
{
}
public void SetInviteFriendPanel()
{
invitefriendPanel.gameObject.SetActive(true);
2024-11-26 00:40:56 +08:00
transform.gameObject.SetActive(false);
2024-11-25 22:18:57 +08:00
}
public void SetInviteFriendsPanel()
{
transform.gameObject.SetActive(false);
personalcenterPanel.gameObject.SetActive(true);
}
}