EnduringGiftBoxController.cs 878 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. namespace GFGGame
  3. {
  4. public class EnduringGiftBoxController : SingletonBase<EnduringGiftBoxController>
  5. {
  6. private static EnduringGiftBoxView _enduringGiftBoxView;
  7. public static void Show(int itemId, int count, Action onSuccess = null, string message = "", int type = 0)
  8. {
  9. if (_enduringGiftBoxView == null)
  10. {
  11. _enduringGiftBoxView = new EnduringGiftBoxView();
  12. }
  13. _enduringGiftBoxView.SetParams(itemId, count, onSuccess, message, type);
  14. _enduringGiftBoxView.Show();
  15. }
  16. public static void hide()
  17. {
  18. if (_enduringGiftBoxView != null)
  19. {
  20. _enduringGiftBoxView.Hide();
  21. }
  22. }
  23. public static void Dispose()
  24. {
  25. _enduringGiftBoxView = null;
  26. }
  27. }
  28. }