BqItemComp.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Api;
  5. using Plugins.CxShine.page;
  6. using UI;
  7. using UnityEngine;
  8. using UnityEngine.UI;
  9. public class BqItemComp : MonoBehaviour
  10. {
  11. public GameObject PreparePagePrefab;
  12. public Text PlayerIdText;
  13. private Action<PlayerInfo> onClose;
  14. private PlayerInfo invitePlayer;
  15. private Action<PlayerInfo> onAccept;
  16. void Start()
  17. {
  18. }
  19. // Update is called once per frame
  20. void Update()
  21. {
  22. }
  23. public void init(PlayerInfo invitePlayer, Action<PlayerInfo> onAccept, Action<PlayerInfo> onClose)
  24. {
  25. this.invitePlayer = invitePlayer;
  26. this.onClose = onClose;
  27. this.onAccept = onAccept;
  28. PlayerIdText.text = PlayerIdText.text.Replace("%d", "" + invitePlayer.playerId);
  29. Invoke(nameof(A__ClickClose), 10.0f);
  30. }
  31. public void A__ClickClose()
  32. {
  33. onClose.Invoke(invitePlayer);
  34. Destroy(gameObject);
  35. }
  36. public void A__CLickAccept()
  37. {
  38. onAccept.Invoke(this.invitePlayer);
  39. }
  40. }