暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PurchasingGameService.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #if SERVICES_SDK_CORE_ENABLED
  2. using System;
  3. using Unity.Services.Core.Editor;
  4. using Unity.Services.Core.Editor.OrganizationHandler;
  5. using UnityEngine;
  6. namespace UnityEditor.Purchasing
  7. {
  8. internal class PurchasingGameService : IEditorGameService
  9. {
  10. const string k_ServiceName = "Purchasing";
  11. readonly PurchasingServiceEnabler m_Enabler;
  12. readonly PurchasingServiceIdentifier m_Identifier;
  13. public PurchasingGameService()
  14. {
  15. m_Enabler = new PurchasingServiceEnabler();
  16. m_Identifier = new PurchasingServiceIdentifier();
  17. }
  18. public void AddEnableAction(Action toAdd)
  19. {
  20. m_Enabler.OnServiceEnabled += toAdd;
  21. }
  22. public void RemoveEnableAction(Action toRemove)
  23. {
  24. m_Enabler.OnServiceEnabled -= toRemove;
  25. }
  26. public void AddDisableAction(Action toAdd)
  27. {
  28. m_Enabler.OnServiceDisabled += toAdd;
  29. }
  30. public void RemoveDisableAction(Action toRemove)
  31. {
  32. m_Enabler.OnServiceDisabled -= toRemove;
  33. }
  34. public string Name => k_ServiceName;
  35. public IEditorGameServiceIdentifier Identifier => m_Identifier;
  36. public bool RequiresCoppaCompliance => true;
  37. public bool HasDashboard => true;
  38. public string GetFormattedDashboardUrl()
  39. {
  40. return $"https://dashboard.unity3d.com/organizations/{OrganizationProvider.Organization.Key}/projects/{CloudProjectSettings.projectId}/analytics/v2/dashboards/revenue";
  41. }
  42. public IEditorGameServiceEnabler Enabler => m_Enabler;
  43. }
  44. }
  45. #endif