IPlacementContentOperations.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Collections.Generic;
  2. namespace UnityEngine.Monetization
  3. {
  4. public interface IPlacementContentOperations
  5. {
  6. void SendCustomEvent(CustomEvent customEvent);
  7. bool ready { get; }
  8. PlacementContentState state { get; }
  9. }
  10. public interface IRewardedOperations : IPlacementContentOperations
  11. {
  12. bool IsRewarded();
  13. string rewardId { get; }
  14. }
  15. /// <summary>
  16. /// ShowResult is passed to [[ShowOptions.resultCallback]] after the advertisement has completed.
  17. /// </summary>
  18. public enum ShowResult
  19. {
  20. /// <summary>
  21. /// Indicates that the advertisement failed to complete.
  22. /// </summary>
  23. Failed,
  24. /// <summary>
  25. /// Indicates that the advertisement was skipped.
  26. /// </summary>
  27. Skipped,
  28. /// <summary>
  29. /// Indicates that the advertisement completed successfully.
  30. /// </summary>
  31. Finished
  32. }
  33. public delegate void ShowAdFinishCallback(ShowResult finishState);
  34. public delegate void ShowAdStartCallback();
  35. public struct ShowAdCallbacks
  36. {
  37. public ShowAdFinishCallback finishCallback;
  38. public ShowAdStartCallback startCallback;
  39. }
  40. public interface IShowAdOperations : IRewardedOperations
  41. {
  42. void Show(ShowAdCallbacks? callbacks);
  43. }
  44. public interface IPromoAdOperations : IShowAdOperations
  45. {
  46. PromoMetadata metadata { get; }
  47. }
  48. }