using System; using System.Collections; using System.Collections.Generic; using Api; using Plugins.CxShine.page; using UI; using UnityEngine; using UnityEngine.UI; public class BqItemComp : MonoBehaviour { public GameObject PreparePagePrefab; public Text PlayerIdText; private Action onClose; private PlayerInfo invitePlayer; private Action onAccept; void Start() { } // Update is called once per frame void Update() { } public void init(PlayerInfo invitePlayer, Action onAccept, Action onClose) { this.invitePlayer = invitePlayer; this.onClose = onClose; this.onAccept = onAccept; PlayerIdText.text = PlayerIdText.text.Replace("%d", "" + invitePlayer.playerId); Invoke(nameof(A__ClickClose), 10.0f); } public void A__ClickClose() { onClose.Invoke(invitePlayer); Destroy(gameObject); } public void A__CLickAccept() { onAccept.Invoke(this.invitePlayer); } }