com.usercentrics.sdk 0.0.0-stage → 2.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/Documentation/LICENSE +2 -0
  2. package/Documentation/LICENSE.meta +7 -0
  3. package/Documentation/README +169 -0
  4. package/Documentation/README.meta +7 -0
  5. package/Documentation.meta +8 -0
  6. package/Editor/ATTLocalizationMessageDrawer.cs +92 -0
  7. package/Editor/ATTLocalizationMessageDrawer.cs.meta +11 -0
  8. package/Editor/AssemblyInfo.cs +4 -0
  9. package/Editor/AssemblyInfo.cs.meta +11 -0
  10. package/Editor/Unity.UsercentricsEditor.asmdef +18 -0
  11. package/Editor/Unity.UsercentricsEditor.asmdef.meta +7 -0
  12. package/Editor/UsercentricsATTPostProcessor.cs +125 -0
  13. package/Editor/UsercentricsATTPostProcessor.cs.meta +11 -0
  14. package/Editor/UsercentricsAndroidPostBuild.cs +45 -0
  15. package/Editor/UsercentricsAndroidPostBuild.cs.meta +11 -0
  16. package/Editor/UsercentricsAndroidSdkCheck.cs +29 -0
  17. package/Editor/UsercentricsAndroidSdkCheck.cs.meta +11 -0
  18. package/Editor/UsercentricsDependencies.xml +18 -0
  19. package/Editor/UsercentricsDependencies.xml.meta +7 -0
  20. package/Editor/UsercentricsExternalDependencyManagerBuildCheck.cs +56 -0
  21. package/Editor/UsercentricsExternalDependencyManagerBuildCheck.cs.meta +11 -0
  22. package/Editor/UsercentricsExternalDependencyManagerCheck.cs +34 -0
  23. package/Editor/UsercentricsExternalDependencyManagerCheck.cs.meta +11 -0
  24. package/Editor/UsercentricsIOSBuildFixes.cs +171 -0
  25. package/Editor/UsercentricsIOSBuildFixes.cs.meta +11 -0
  26. package/Editor/UsercentricsPBXProjectExtensions.cs +281 -0
  27. package/Editor/UsercentricsPBXProjectExtensions.cs.meta +11 -0
  28. package/Editor/UsercentricsPodfilePatches.cs +116 -0
  29. package/Editor/UsercentricsPodfilePatches.cs.meta +11 -0
  30. package/Editor/UsercentricsSentryExcludePostBuild.cs +77 -0
  31. package/Editor/UsercentricsSentryExcludePostBuild.cs.meta +11 -0
  32. package/Editor/UsercentricsSentryGradleExclude.cs +189 -0
  33. package/Editor/UsercentricsSentryGradleExclude.cs.meta +11 -0
  34. package/Editor/UsercentricsWelcomeDialog.cs +76 -0
  35. package/Editor/UsercentricsWelcomeDialog.cs.meta +11 -0
  36. package/Editor.meta +8 -0
  37. package/Prefabs/ATTManager.prefab +47 -0
  38. package/Prefabs/ATTManager.prefab.meta +7 -0
  39. package/Prefabs/Usercentrics.prefab +74 -0
  40. package/Prefabs/Usercentrics.prefab.meta +7 -0
  41. package/Prefabs.meta +8 -0
  42. package/Scripts/AppTrackingTransparency/AppTrackingTransparencyManager.cs +59 -0
  43. package/Scripts/AppTrackingTransparency/AppTrackingTransparencyManager.cs.meta +11 -0
  44. package/Scripts/AppTrackingTransparency/Model/ATTLocalizationMessage.cs +15 -0
  45. package/Scripts/AppTrackingTransparency/Model/ATTLocalizationMessage.cs.meta +11 -0
  46. package/Scripts/AppTrackingTransparency/Model/AuthorizationStatus.cs +10 -0
  47. package/Scripts/AppTrackingTransparency/Model/AuthorizationStatus.cs.meta +11 -0
  48. package/Scripts/AppTrackingTransparency/Model/Language.cs +136 -0
  49. package/Scripts/AppTrackingTransparency/Model/Language.cs.meta +11 -0
  50. package/Scripts/AppTrackingTransparency/Model.meta +8 -0
  51. package/Scripts/AppTrackingTransparency.cs +60 -0
  52. package/Scripts/AppTrackingTransparency.cs.meta +11 -0
  53. package/Scripts/AppTrackingTransparency.meta +8 -0
  54. package/Scripts/Internal/AssemblyInfo.cs +3 -0
  55. package/Scripts/Internal/AssemblyInfo.cs.meta +11 -0
  56. package/Scripts/Internal/AutoInitialize.cs +42 -0
  57. package/Scripts/Internal/AutoInitialize.cs.meta +11 -0
  58. package/Scripts/Internal/BannerSettings.cs +165 -0
  59. package/Scripts/Internal/BannerSettings.cs.meta +11 -0
  60. package/Scripts/Internal/ConsentUpdateSubscriptionCoordinator.cs +42 -0
  61. package/Scripts/Internal/ConsentUpdateSubscriptionCoordinator.cs.meta +11 -0
  62. package/Scripts/Internal/Data.cs +960 -0
  63. package/Scripts/Internal/Data.cs.meta +11 -0
  64. package/Scripts/Internal/Errors.cs +22 -0
  65. package/Scripts/Internal/Errors.cs.meta +11 -0
  66. package/Scripts/Internal/FirstLayerStyleSettings.cs +248 -0
  67. package/Scripts/Internal/FirstLayerStyleSettings.cs.meta +11 -0
  68. package/Scripts/Internal/IUsercentrics.cs +45 -0
  69. package/Scripts/Internal/IUsercentrics.cs.meta +11 -0
  70. package/Scripts/Internal/InspectorLink.cs +27 -0
  71. package/Scripts/Internal/InspectorLink.cs.meta +11 -0
  72. package/Scripts/Internal/Singleton.cs +68 -0
  73. package/Scripts/Internal/Singleton.cs.meta +11 -0
  74. package/Scripts/Internal/StringParser.cs +41 -0
  75. package/Scripts/Internal/StringParser.cs.meta +11 -0
  76. package/Scripts/Internal/UCConstants.cs +13 -0
  77. package/Scripts/Internal/UCConstants.cs.meta +11 -0
  78. package/Scripts/Internal/UnityConsentModeAdapter.cs +78 -0
  79. package/Scripts/Internal/UnityConsentModeAdapter.cs.meta +11 -0
  80. package/Scripts/Internal/UsercentricsAndroid.cs +210 -0
  81. package/Scripts/Internal/UsercentricsAndroid.cs.meta +11 -0
  82. package/Scripts/Internal/UsercentricsIOS.cs +307 -0
  83. package/Scripts/Internal/UsercentricsIOS.cs.meta +11 -0
  84. package/Scripts/Internal.meta +8 -0
  85. package/Scripts/Unity.Usercentrics.asmdef +14 -0
  86. package/Scripts/Unity.Usercentrics.asmdef.meta +7 -0
  87. package/Scripts/Usercentrics.cs +1160 -0
  88. package/Scripts/Usercentrics.cs.meta +11 -0
  89. package/Scripts.meta +8 -0
  90. package/UsercentricsInstallGuard/Usercentrics.InstallGuard.asmdef +16 -0
  91. package/UsercentricsInstallGuard/Usercentrics.InstallGuard.asmdef.meta +7 -0
  92. package/UsercentricsInstallGuard/UsercentricsInstallGuard.cs +82 -0
  93. package/UsercentricsInstallGuard/UsercentricsInstallGuard.cs.meta +11 -0
  94. package/UsercentricsInstallGuard.meta +8 -0
  95. package/iOS/TrackingTransparencyManager.h +13 -0
  96. package/iOS/TrackingTransparencyManager.h.meta +27 -0
  97. package/iOS/TrackingTransparencyManager.mm +99 -0
  98. package/iOS/TrackingTransparencyManager.mm.meta +37 -0
  99. package/iOS/Usercentrics.mm +228 -0
  100. package/iOS/Usercentrics.mm.meta +37 -0
  101. package/iOS/UsercentricsATTManager.mm +21 -0
  102. package/iOS/UsercentricsATTManager.mm.meta +37 -0
  103. package/iOS.meta +8 -0
  104. package/link.xml +24 -0
  105. package/link.xml.meta +7 -0
  106. package/package.json +10 -4
  107. package/package.json.meta +7 -0
  108. package/README.md +0 -3
@@ -0,0 +1,59 @@
1
+ #if UNITY_IOS
2
+ using System.Runtime.InteropServices;
3
+ using AOT;
4
+ using UnityEngine.Events;
5
+
6
+ namespace Unity.Usercentrics
7
+ {
8
+ public class AppTrackingTransparencyManager
9
+ {
10
+
11
+ [DllImport("__Internal")]
12
+ private static extern void ucRequestForAppTrackingTransparency(TrackingTransparencyDelegate callback);
13
+
14
+ [DllImport("__Internal")]
15
+ private static extern int ucInterfaceGetTrackingAuthorizationStatus();
16
+
17
+ public static UnityAction<AuthorizationStatus> AttCallback;
18
+ public static UnityAction<AuthorizationStatus> AttStatusCallback;
19
+ private delegate void TrackingTransparencyDelegate(int status);
20
+
21
+ [MonoPInvokeCallback(typeof(TrackingTransparencyDelegate))]
22
+ private static void DelegateMessageReceived(int number)
23
+ {
24
+ DelegateStatusReceived(number, AttCallback);
25
+ }
26
+
27
+ private static void DelegateStatusReceived(int value, UnityAction<AuthorizationStatus> callback)
28
+ {
29
+ switch (value)
30
+ {
31
+ case 0:
32
+ callback?.Invoke(AuthorizationStatus.NOT_DETERMINED);
33
+ break;
34
+ case 1:
35
+ callback?.Invoke(AuthorizationStatus.RESTRICTED);
36
+ break;
37
+ case 2:
38
+ callback?.Invoke(AuthorizationStatus.DENIED);
39
+ break;
40
+ case 3:
41
+ callback?.Invoke(AuthorizationStatus.AUTHORIZED);
42
+ break;
43
+ default:
44
+ break;
45
+ }
46
+ }
47
+
48
+ public static void RequestForAppTrackingTransparency()
49
+ {
50
+ ucRequestForAppTrackingTransparency(DelegateMessageReceived);
51
+ }
52
+
53
+ public static void GetTrackingAuthorizationStatus()
54
+ {
55
+ DelegateStatusReceived(ucInterfaceGetTrackingAuthorizationStatus(), AttStatusCallback);
56
+ }
57
+ }
58
+ }
59
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 23a827eda11254f4eb2a21cfb0954fe1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,15 @@
1
+ namespace Unity.Usercentrics
2
+ {
3
+ [System.Serializable]
4
+ public class ATTLocalizationMessage
5
+ {
6
+ public Language Language;
7
+ public string PopupMessage = "";
8
+ public string ManualIsoCode;
9
+
10
+ public ATTLocalizationMessage(Language language)
11
+ {
12
+ Language = language;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 936a2ee2304e04d3498ecdb4b24fac9f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,10 @@
1
+ namespace Unity.Usercentrics
2
+ {
3
+ public enum AuthorizationStatus
4
+ {
5
+ AUTHORIZED,
6
+ DENIED,
7
+ NOT_DETERMINED,
8
+ RESTRICTED
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 24f921ca1dac9480da62c2b86092ecb3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,136 @@
1
+ namespace Unity.Usercentrics
2
+ {
3
+ public enum Language
4
+ {
5
+ [IsoCode("ar")]
6
+ Arabic,
7
+
8
+ [IsoCode("ca")]
9
+ Catalan,
10
+
11
+ [IsoCode("zh-HK")]
12
+ ChineseHongKong,
13
+
14
+ [IsoCode("zh-Hans")]
15
+ ChineseSimplified,
16
+
17
+ [IsoCode("zh-Hant")]
18
+ ChineseTraditional,
19
+
20
+ [IsoCode("hr")]
21
+ Croatian,
22
+
23
+ [IsoCode("cs")]
24
+ Czech,
25
+
26
+ [IsoCode("da")]
27
+ Danish,
28
+
29
+ [IsoCode("nl")]
30
+ Dutch,
31
+
32
+ [IsoCode("en-AU")]
33
+ EnglishAustralia,
34
+
35
+ [IsoCode("en-IN")]
36
+ EnglishIndia,
37
+
38
+ [IsoCode("en-GB")]
39
+ EnglishUnitedKingdom,
40
+
41
+ [IsoCode("fi")]
42
+ Finnish,
43
+
44
+ [IsoCode("fr")]
45
+ French,
46
+
47
+ [IsoCode("fr-CA")]
48
+ FrenchCanada,
49
+
50
+ [IsoCode("de")]
51
+ German,
52
+
53
+ [IsoCode("el")]
54
+ Greek,
55
+
56
+ [IsoCode("he")]
57
+ Hebrew,
58
+
59
+ [IsoCode("hi")]
60
+ Hindi,
61
+
62
+ [IsoCode("hu")]
63
+ Hungarian,
64
+
65
+ [IsoCode("id")]
66
+ Indonesian,
67
+
68
+ [IsoCode("it")]
69
+ Italian,
70
+
71
+ [IsoCode("ja")]
72
+ Japanese,
73
+
74
+ [IsoCode("ko")]
75
+ Korean,
76
+
77
+ [IsoCode("ms")]
78
+ Malay,
79
+
80
+ [IsoCode("nb")]
81
+ NorwegianBokmal,
82
+
83
+ [IsoCode("pl")]
84
+ Polish,
85
+
86
+ [IsoCode("pt-PT")]
87
+ PortuguesePortugal,
88
+
89
+ [IsoCode("pt-BR")]
90
+ PortugueseBrazil,
91
+
92
+ [IsoCode("ro")]
93
+ Romanian,
94
+
95
+ [IsoCode("ru")]
96
+ Russian,
97
+
98
+ [IsoCode("sk")]
99
+ Slovak,
100
+
101
+ [IsoCode("es")]
102
+ Spanish,
103
+
104
+ [IsoCode("es-419")]
105
+ SpanishLatinAmerica,
106
+
107
+ [IsoCode("sv")]
108
+ Swedish,
109
+
110
+ [IsoCode("th")]
111
+ Thai,
112
+
113
+ [IsoCode("tr")]
114
+ Turkish,
115
+
116
+ [IsoCode("uk")]
117
+ Ukrainian,
118
+
119
+ [IsoCode("vi")]
120
+ Vietnamese,
121
+
122
+ [IsoCode("other")]
123
+ Other
124
+ }
125
+
126
+ [System.AttributeUsage(System.AttributeTargets.Field)]
127
+ public class IsoCodeAttribute : System.Attribute
128
+ {
129
+ public string Code { get; }
130
+
131
+ public IsoCodeAttribute(string code)
132
+ {
133
+ Code = code;
134
+ }
135
+ }
136
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 173a8dee2b2b840f0a9ec15c0a3076d0
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 211425b805dcd41f7b5001f9668fde0e
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,60 @@
1
+ using System;
2
+ using UnityEngine;
3
+ using UnityEngine.Events;
4
+ using System.Collections.Generic;
5
+
6
+ namespace Unity.Usercentrics
7
+ {
8
+ public class AppTrackingTransparency : Singleton<AppTrackingTransparency>
9
+ {
10
+ #region INSPECTOR FIELDS
11
+
12
+ public string EnglishDefaultMessage = "";
13
+ public static string m_EnglishDefaultMessage = "";
14
+
15
+ public List<ATTLocalizationMessage> LocalizationMessages = new List<ATTLocalizationMessage>();
16
+ public static List<ATTLocalizationMessage> m_LocalizationMessages = new List<ATTLocalizationMessage>();
17
+
18
+ #endregion
19
+
20
+ private void OnValidate()
21
+ {
22
+ m_EnglishDefaultMessage = EnglishDefaultMessage;
23
+ m_LocalizationMessages = LocalizationMessages;
24
+ }
25
+
26
+ /// <summary>
27
+ /// Show Apple Tracking Transparency Popup if needed,
28
+ /// if the user has already interacted with, it will not display anything,
29
+ /// just return the previous input.
30
+ /// </summary>
31
+ /// <param name="attCallback">
32
+ /// Callback block that is invoked when the user interacts with the popup.
33
+ /// </param>
34
+ public void PromptForAppTrackingTransparency(UnityAction<AuthorizationStatus> attCallback)
35
+ {
36
+ #if UNITY_IOS
37
+ AppTrackingTransparencyManager.AttCallback = attCallback;
38
+ AppTrackingTransparencyManager.RequestForAppTrackingTransparency();
39
+ #else
40
+ Debug.Log("AppTrackingTransparency Not supported for this platform.");
41
+ #endif
42
+ }
43
+
44
+ /// <summary>
45
+ /// Get Apple Tracking Transparency user answer.
46
+ /// </summary>
47
+ /// <param name="attCallback">
48
+ /// Callback block that is invoked with the user previous answer of the popup.
49
+ /// </param>
50
+ public void GetAuthorizationStatus(UnityAction<AuthorizationStatus> attStatusCallback)
51
+ {
52
+ #if UNITY_IOS
53
+ AppTrackingTransparencyManager.AttStatusCallback = attStatusCallback;
54
+ AppTrackingTransparencyManager.GetTrackingAuthorizationStatus();
55
+ #else
56
+ Debug.Log("AppTrackingTransparency Not supported for this platform.");
57
+ #endif
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c858a4e8cf41f4b37a4fc8137ec2cb61
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: ae264032892aa40e49f24a2747dbc244
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,3 @@
1
+ using System.Runtime.CompilerServices;
2
+
3
+ [assembly: InternalsVisibleTo("Unity.Usercentrics.Tests")]
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 717a8f8eea81042488b1dd3ded6eecc1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,42 @@
1
+ using Unity.Usercentrics;
2
+ using UnityEngine;
3
+
4
+ namespace Unity.Usercentrics
5
+ {
6
+ public class AutoInitialize : MonoBehaviour
7
+ {
8
+ [SerializeField] public bool Enabled = true;
9
+
10
+ void Awake()
11
+ {
12
+ Debug.Log("[USERCENTRICS] AutoInitialize is " + Enabled);
13
+
14
+ if (!Enabled)
15
+ {
16
+ return;
17
+ }
18
+
19
+ Usercentrics.Instance.Initialize((status) =>
20
+ {
21
+ if (status.geolocationRuleset.bannerRequiredAtLocation == false)
22
+ {
23
+ return;
24
+ }
25
+
26
+ if (status.shouldCollectConsent)
27
+ {
28
+ ShowFirstLayer();
29
+ }
30
+ },
31
+ (errorMessage) =>
32
+ {
33
+ Debug.Log("[USERCENTRICS] Error on AutoInitialize " + errorMessage);
34
+ });
35
+ }
36
+
37
+ private void ShowFirstLayer()
38
+ {
39
+ Usercentrics.Instance.ShowFirstLayer((usercentricsConsentUserResponse) => {});
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 8cf8fd1d44a31436596d50528c9357a5
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,165 @@
1
+ using System;
2
+
3
+ namespace Unity.Usercentrics
4
+ {
5
+
6
+ [Serializable]
7
+ public class BannerSettings
8
+ {
9
+ public GeneralStyleSettings generalStyleSettings;
10
+ public FirstLayerStyleSettings firstLayerStyleSettings;
11
+ public SecondLayerStyleSettings secondLayerStyleSettings = null;
12
+ public string variantName;
13
+
14
+ public BannerSettings(GeneralStyleSettings generalStyleSettings = null,
15
+ FirstLayerStyleSettings firstLayerStyleSettings = null,
16
+ SecondLayerStyleSettings secondLayerStyleSettings = null,
17
+ string variantName = "")
18
+ {
19
+ this.generalStyleSettings = generalStyleSettings;
20
+ this.firstLayerStyleSettings = firstLayerStyleSettings ?? DefaultFirstLayerSettings();
21
+ this.secondLayerStyleSettings = secondLayerStyleSettings;
22
+ this.variantName = variantName;
23
+ }
24
+
25
+ private FirstLayerStyleSettings DefaultFirstLayerSettings()
26
+ {
27
+ return new FirstLayerStyleSettings(
28
+ layout: UsercentricsLayout.Undefined,
29
+ headerImage: HeaderImageSettings.Undefined(),
30
+ title: new TitleSettings(
31
+ alignment: SectionAlignment.Undefined,
32
+ textSize: 0.0F,
33
+ textColor: ""
34
+ ),
35
+ message: new MessageSettings(
36
+ textSize: 0.0F,
37
+ alignment: SectionAlignment.Undefined,
38
+ textColor: "",
39
+ linkTextColor: "",
40
+ underlineLink: true
41
+ ),
42
+ buttonLayout: ButtonLayout.Undefined(),
43
+ backgroundColor: "",
44
+ cornerRadius: 0.0F,
45
+ overlayColor: "",
46
+ overlayAlpha: 0.0F
47
+ );
48
+ }
49
+ }
50
+
51
+ [Serializable]
52
+ public class GeneralStyleSettings
53
+ {
54
+ public bool androidDisableSystemBackButton;
55
+ public string androidStatusBarColor;
56
+ public bool androidWindowFullscreen;
57
+ public string textColor;
58
+ public string layerBackgroundColor;
59
+ public string layerBackgroundSecondaryColor;
60
+ public string linkColor;
61
+ public string tabColor;
62
+ public string bordersColor;
63
+ public ToggleStyleSettings toggleStyleSettings = null;
64
+ public string logoImageUrl;
65
+ public LegalLinksSettings links;
66
+ public LandscapeLayoutSettings landscapeLayout = null;
67
+
68
+ private GeneralStyleSettings() {}
69
+
70
+ public GeneralStyleSettings(bool androidDisableSystemBackButton = true,
71
+ string androidStatusBarColor = "",
72
+ bool androidWindowFullscreen = true,
73
+ string textColor = "",
74
+ string layerBackgroundColor = "",
75
+ string layerBackgroundSecondaryColor = "",
76
+ string linkColor = "",
77
+ string tabColor = "",
78
+ string bordersColor = "",
79
+ ToggleStyleSettings toggleStyleSettings = null,
80
+ string logoImageUrl = "",
81
+ LegalLinksSettings links = LegalLinksSettings.Undefined,
82
+ LandscapeLayoutSettings landscapeLayout = null)
83
+ {
84
+ this.androidDisableSystemBackButton = androidDisableSystemBackButton;
85
+ this.androidStatusBarColor = androidStatusBarColor;
86
+ this.androidWindowFullscreen = androidWindowFullscreen;
87
+ this.textColor = textColor;
88
+ this.layerBackgroundColor = layerBackgroundColor;
89
+ this.layerBackgroundSecondaryColor = layerBackgroundSecondaryColor;
90
+ this.linkColor = linkColor;
91
+ this.tabColor = tabColor;
92
+ this.bordersColor = bordersColor;
93
+ this.toggleStyleSettings = toggleStyleSettings;
94
+ this.logoImageUrl = logoImageUrl;
95
+ this.links = links;
96
+ this.landscapeLayout = landscapeLayout;
97
+ }
98
+ }
99
+
100
+ /// <summary>
101
+ /// Experimental. Opt-in to the two-panel landscape layout of the first and second layer, intended for
102
+ /// landscape-only games. It is used only when the screen is wider than tall (about 700 x 300 dp or more);
103
+ /// otherwise, and when disabled (the default), the standard layout is shown. The shape of this setting may
104
+ /// change in a later release.
105
+ /// </summary>
106
+ [Serializable]
107
+ public class LandscapeLayoutSettings
108
+ {
109
+ public bool enabled;
110
+
111
+ private LandscapeLayoutSettings() {}
112
+
113
+ public LandscapeLayoutSettings(bool enabled = false)
114
+ {
115
+ this.enabled = enabled;
116
+ }
117
+ }
118
+
119
+ [Serializable]
120
+ public class SecondLayerStyleSettings
121
+ {
122
+ public bool showCloseButton;
123
+
124
+ public SecondLayerStyleSettings(bool showCloseButton)
125
+ {
126
+ this.showCloseButton = showCloseButton;
127
+ }
128
+ }
129
+
130
+ [Serializable]
131
+ public class ToggleStyleSettings
132
+ {
133
+ public string activeBackgroundColor;
134
+ public string inactiveBackgroundColor;
135
+ public string disabledBackgroundColor;
136
+ public string activeThumbColor;
137
+ public string inactiveThumbColor;
138
+ public string disabledThumbColor;
139
+
140
+ public ToggleStyleSettings(string activeBackgroundColor = "",
141
+ string inactiveBackgroundColor = "",
142
+ string disabledBackgroundColor = "",
143
+ string activeThumbColor = "",
144
+ string inactiveThumbColor = "",
145
+ string disabledThumbColor = "")
146
+ {
147
+ this.activeBackgroundColor = activeBackgroundColor;
148
+ this.inactiveBackgroundColor = inactiveBackgroundColor;
149
+ this.disabledBackgroundColor = disabledBackgroundColor;
150
+ this.activeThumbColor = activeThumbColor;
151
+ this.inactiveThumbColor = inactiveThumbColor;
152
+ this.disabledThumbColor = disabledThumbColor;
153
+ }
154
+ }
155
+
156
+ [Serializable]
157
+ public enum LegalLinksSettings
158
+ {
159
+ Undefined,
160
+ FirstLayerOnly,
161
+ SecondLayerOnly,
162
+ Both,
163
+ Hidden
164
+ }
165
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: cb0b4d4273d49458ea8439daf404a02f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,42 @@
1
+ namespace Unity.Usercentrics
2
+ {
3
+ /// <summary>
4
+ /// Tracks whether the native onConsentUpdated bridge subscription should be active,
5
+ /// coordinating between the public SubscribeOnConsentUpdated/DisposeOnConsentUpdatedSubscription
6
+ /// API and the internal Unity Consent Mode listener, so that a game disposing its own
7
+ /// public subscription never silently kills the internal listener (and vice versa).
8
+ /// </summary>
9
+ internal class ConsentUpdateSubscriptionCoordinator
10
+ {
11
+ private int publicSubscriberCount;
12
+ private bool internalSubscriptionActive;
13
+
14
+ /// <returns>true if the native bridge subscription should now be started.</returns>
15
+ public bool RegisterPublicSubscriber()
16
+ {
17
+ bool shouldSubscribeNative = publicSubscriberCount == 0 && !internalSubscriptionActive;
18
+ publicSubscriberCount++;
19
+ return shouldSubscribeNative;
20
+ }
21
+
22
+ /// <returns>true if the native bridge subscription should now be disposed.</returns>
23
+ public bool ClearPublicSubscribers()
24
+ {
25
+ publicSubscriberCount = 0;
26
+ return !internalSubscriptionActive;
27
+ }
28
+
29
+ /// <returns>true if the native bridge subscription should now be started.</returns>
30
+ public bool RegisterInternalSubscription()
31
+ {
32
+ if (internalSubscriptionActive)
33
+ {
34
+ return false;
35
+ }
36
+
37
+ bool shouldSubscribeNative = publicSubscriberCount == 0;
38
+ internalSubscriptionActive = true;
39
+ return shouldSubscribeNative;
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c4b0352b55234e48860ea86d42357131
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: