com.amanotes.gdk 0.1.3
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.
- package/CHANGELOG.md +6 -0
- package/CHANGELOG.md.meta +7 -0
- package/Editor/AmaGDK.Editor.asmdef +18 -0
- package/Editor/AmaGDK.Editor.asmdef.meta +7 -0
- package/Editor/AmaGDKEditor.cs +210 -0
- package/Editor/AmaGDKEditor.cs.meta +11 -0
- package/Editor.meta +8 -0
- package/LICENSE.md +7 -0
- package/LICENSE.md.meta +7 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKConfig.unitypackage.meta +8 -0
- package/Packages/AppsflyerAdapter_v6.5.4.unitypackage +0 -0
- package/Packages/AppsflyerAdapter_v6.5.4.unitypackage.meta +7 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage.meta +7 -0
- package/Packages.meta +8 -0
- package/README.md +44 -0
- package/README.md.meta +7 -0
- package/Runtime/AmaGDK.Adapters.cs +45 -0
- package/Runtime/AmaGDK.Adapters.cs.meta +11 -0
- package/Runtime/AmaGDK.Analytics.cs +454 -0
- package/Runtime/AmaGDK.Analytics.cs.meta +11 -0
- package/Runtime/AmaGDK.Config.cs +13 -0
- package/Runtime/AmaGDK.Config.cs.meta +11 -0
- package/Runtime/AmaGDK.Internal.cs +133 -0
- package/Runtime/AmaGDK.Internal.cs.meta +11 -0
- package/Runtime/AmaGDK.UserProfile.cs +41 -0
- package/Runtime/AmaGDK.UserProfile.cs.meta +11 -0
- package/Runtime/AmaGDK.Utils.cs +121 -0
- package/Runtime/AmaGDK.Utils.cs.meta +11 -0
- package/Runtime/AmaGDK.asmdef +14 -0
- package/Runtime/AmaGDK.asmdef.meta +7 -0
- package/Runtime/AmaGDK.cs +159 -0
- package/Runtime/AmaGDK.cs.meta +11 -0
- package/Runtime/AmaGDK.prefab +46 -0
- package/Runtime/AmaGDK.prefab.meta +8 -0
- package/Runtime/AssemblyInfo.cs +8 -0
- package/Runtime/AssemblyInfo.cs.meta +11 -0
- package/Runtime/Interfaces/Analytics/IAnalytics.cs +6 -0
- package/Runtime/Interfaces/Analytics/IAnalytics.cs.meta +11 -0
- package/Runtime/Interfaces/Analytics.meta +8 -0
- package/Runtime/Interfaces.meta +8 -0
- package/Runtime.meta +8 -0
- package/Tests/Editor/AmaGDK.Editor.Test.asmdef +23 -0
- package/Tests/Editor/AmaGDK.Editor.Test.asmdef.meta +7 -0
- package/Tests/Editor.meta +8 -0
- package/Tests/Runtime/AmaGDK.Test.asmdef +20 -0
- package/Tests/Runtime/AmaGDK.Test.asmdef.meta +7 -0
- package/Tests/Runtime/AmaGDKCoreTest.cs +229 -0
- package/Tests/Runtime/AmaGDKCoreTest.cs.meta +11 -0
- package/Tests/Runtime/MigrationTest.cs +165 -0
- package/Tests/Runtime/MigrationTest.cs.meta +11 -0
- package/Tests/Runtime.meta +8 -0
- package/Tests/TestScene00.unity +125 -0
- package/Tests/TestScene00.unity.meta +7 -0
- package/Tests/TestScene01.unity +199 -0
- package/Tests/TestScene01.unity.meta +7 -0
- package/Tests/TestScene02.unity +209 -0
- package/Tests/TestScene02.unity.meta +7 -0
- package/Tests/TestScene03.unity +599 -0
- package/Tests/TestScene03.unity.meta +7 -0
- package/Tests.meta +8 -0
- package/package.json +18 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections;
|
|
3
|
+
using System.Text.RegularExpressions;
|
|
4
|
+
using Amanotes.Core;
|
|
5
|
+
using NUnit.Framework;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using UnityEngine.SceneManagement;
|
|
8
|
+
using UnityEngine.TestTools;
|
|
9
|
+
|
|
10
|
+
using static Amanotes.Core.Internal.Messsage;
|
|
11
|
+
using Amanotes.Core.Internal;
|
|
12
|
+
|
|
13
|
+
public class AmaGDKCoreTest
|
|
14
|
+
{
|
|
15
|
+
const float AMAGDK_INIT_DURATION = 0.1f;
|
|
16
|
+
const string SCENE_WITH_AUTOINIT_ON = "TestScene01";
|
|
17
|
+
const string SCENE_WITH_AUTOINIT_OFF = "TestScene02";
|
|
18
|
+
const string SCENE_WITH_MULTI_AUTOINIT_ON = "TestScene03";
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[UnityTest] public IEnumerator AmaGDK_Init_MultipleTimes()
|
|
22
|
+
{
|
|
23
|
+
ClearAndResetAmaGDK();
|
|
24
|
+
yield return null;
|
|
25
|
+
yield return null;
|
|
26
|
+
|
|
27
|
+
AmaGDK.Init();
|
|
28
|
+
AmaGDK.Init();
|
|
29
|
+
LogAssert.Expect(LogType.Warning, new Regex(SDK_INIT_CALLED));
|
|
30
|
+
|
|
31
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
32
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[UnityTest] public IEnumerator AmaGDK_Init_Then_AutoInit()
|
|
36
|
+
{
|
|
37
|
+
ClearAndResetAmaGDK();
|
|
38
|
+
yield return null;
|
|
39
|
+
yield return null;
|
|
40
|
+
|
|
41
|
+
AmaGDK.Init();
|
|
42
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_ON, LoadSceneMode.Single);
|
|
43
|
+
LogAssert.Expect(LogType.Warning, new Regex(MULTIPLE_INSTANCE));
|
|
44
|
+
|
|
45
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
46
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[UnityTest] public IEnumerator AmaGDK_AutoInit_Then_Init()
|
|
50
|
+
{
|
|
51
|
+
ClearAndResetAmaGDK();
|
|
52
|
+
yield return null;
|
|
53
|
+
yield return null;
|
|
54
|
+
|
|
55
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_ON, LoadSceneMode.Single);
|
|
56
|
+
yield return null; // Took 1 frame for scene ready (call Awake)
|
|
57
|
+
|
|
58
|
+
AmaGDK.Init();
|
|
59
|
+
LogAssert.Expect(LogType.Warning, new Regex(SDK_INIT_CALLED));
|
|
60
|
+
|
|
61
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
62
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[UnityTest] public IEnumerator AmaGDK_Init_Then_DisabledAutoInit()
|
|
66
|
+
{
|
|
67
|
+
ClearAndResetAmaGDK();
|
|
68
|
+
yield return null;
|
|
69
|
+
yield return null;
|
|
70
|
+
|
|
71
|
+
AmaGDK.Init();
|
|
72
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_OFF, LoadSceneMode.Single);
|
|
73
|
+
LogAssert.NoUnexpectedReceived();
|
|
74
|
+
|
|
75
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
76
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[UnityTest] public IEnumerator AmaGDK_DisabledAutoInit_Then_Init()
|
|
80
|
+
{
|
|
81
|
+
ClearAndResetAmaGDK();
|
|
82
|
+
yield return null;
|
|
83
|
+
yield return null;
|
|
84
|
+
|
|
85
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_OFF, LoadSceneMode.Single);
|
|
86
|
+
yield return null; // Took 1 frame for scene ready (call Awake)
|
|
87
|
+
AmaGDK.Init();
|
|
88
|
+
LogAssert.NoUnexpectedReceived();
|
|
89
|
+
|
|
90
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
91
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
[UnityTest] public IEnumerator AmaGDK_ShouldBeReadyWithin10Secs()
|
|
95
|
+
{
|
|
96
|
+
ClearAndResetAmaGDK();
|
|
97
|
+
yield return null;
|
|
98
|
+
yield return null;
|
|
99
|
+
|
|
100
|
+
AmaGDK.Init();
|
|
101
|
+
|
|
102
|
+
var frameCount = 0;
|
|
103
|
+
var stTime = Time.realtimeSinceStartup;
|
|
104
|
+
const float TIMEOUT = 10f;
|
|
105
|
+
|
|
106
|
+
while (!AmaGDK.isReady){
|
|
107
|
+
yield return null;
|
|
108
|
+
frameCount++;
|
|
109
|
+
|
|
110
|
+
if (Time.realtimeSinceStartup - stTime > TIMEOUT)
|
|
111
|
+
{
|
|
112
|
+
Debug.LogWarning($"AmaGDK took too long to init: Not ready after {TIMEOUT} secs ({frameCount} frames)");
|
|
113
|
+
yield break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var initTime = Time.realtimeSinceStartup - stTime;
|
|
118
|
+
Debug.Log($"AmaGDK ready in {initTime} secs ({frameCount} frames)!");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[UnityTest] public IEnumerator AmaGDK_IsSingleton()
|
|
122
|
+
{
|
|
123
|
+
ClearAndResetAmaGDK();
|
|
124
|
+
yield return null;
|
|
125
|
+
yield return null;
|
|
126
|
+
|
|
127
|
+
AmaGDK.Init();
|
|
128
|
+
yield return null;
|
|
129
|
+
yield return null;
|
|
130
|
+
|
|
131
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_ON, LoadSceneMode.Additive);
|
|
132
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_ON, LoadSceneMode.Additive);
|
|
133
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_ON, LoadSceneMode.Additive);
|
|
134
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_OFF, LoadSceneMode.Additive);
|
|
135
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_OFF, LoadSceneMode.Additive);
|
|
136
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_OFF, LoadSceneMode.Additive);
|
|
137
|
+
SceneManager.LoadScene(SCENE_WITH_AUTOINIT_OFF, LoadSceneMode.Additive);
|
|
138
|
+
yield return null;
|
|
139
|
+
yield return null;
|
|
140
|
+
|
|
141
|
+
UnloadAndGC();
|
|
142
|
+
yield return null;
|
|
143
|
+
|
|
144
|
+
Assert.AreEqual(1, CountUnityObject<AmaGDK>());
|
|
145
|
+
LogAssert.Expect(LogType.Warning, new Regex(MULTIPLE_INSTANCE));
|
|
146
|
+
|
|
147
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
148
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[UnityTest] public IEnumerator AmaGDK_SceneWithMultipleAmaGDKPrefabs()
|
|
152
|
+
{
|
|
153
|
+
ClearAndResetAmaGDK();
|
|
154
|
+
yield return null;
|
|
155
|
+
yield return null;
|
|
156
|
+
|
|
157
|
+
SceneManager.LoadScene(SCENE_WITH_MULTI_AUTOINIT_ON);
|
|
158
|
+
yield return null;
|
|
159
|
+
yield return null;
|
|
160
|
+
|
|
161
|
+
UnloadAndGC();
|
|
162
|
+
yield return null;
|
|
163
|
+
|
|
164
|
+
Assert.AreEqual(1, CountUnityObject<AmaGDK>());
|
|
165
|
+
LogAssert.Expect(LogType.Warning, new Regex(MULTIPLE_INSTANCE));
|
|
166
|
+
|
|
167
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
168
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[UnityTest] public IEnumerator AmaGDK_PersistentThroughSceneLoad()
|
|
172
|
+
{
|
|
173
|
+
ClearAndResetAmaGDK();
|
|
174
|
+
yield return null;
|
|
175
|
+
yield return null;
|
|
176
|
+
|
|
177
|
+
AmaGDK.Init();
|
|
178
|
+
yield return null;
|
|
179
|
+
yield return null;
|
|
180
|
+
|
|
181
|
+
SceneManager.LoadScene(1);
|
|
182
|
+
yield return null;
|
|
183
|
+
|
|
184
|
+
SceneManager.LoadScene(2);
|
|
185
|
+
yield return null;
|
|
186
|
+
|
|
187
|
+
// Clean up
|
|
188
|
+
UnloadAndGC();
|
|
189
|
+
yield return null;
|
|
190
|
+
|
|
191
|
+
Assert.AreEqual(1, CountUnityObject<AmaGDK>());
|
|
192
|
+
|
|
193
|
+
yield return new WaitForSeconds(AMAGDK_INIT_DURATION);
|
|
194
|
+
Assert.IsTrue(AmaGDK.isReady);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
// UTILS
|
|
199
|
+
private static int CountUnityObject<T>() where T : UnityEngine.Object
|
|
200
|
+
{
|
|
201
|
+
var result = Resources.FindObjectsOfTypeAll<T>();
|
|
202
|
+
var count = 0;
|
|
203
|
+
|
|
204
|
+
for (var i = 0; i < result.Length; i++)
|
|
205
|
+
{
|
|
206
|
+
#if UNITY_EDITOR // Ignore loaded prefabs assets
|
|
207
|
+
{
|
|
208
|
+
var path = UnityEditor.AssetDatabase.GetAssetPath(result[i]);
|
|
209
|
+
if (!string.IsNullOrEmpty(path)) continue;
|
|
210
|
+
}
|
|
211
|
+
#endif
|
|
212
|
+
count++;
|
|
213
|
+
Debug.Log($"{i + 1} - {result[i]} - {result[i].GetInstanceID()}");
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return count;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
private static void ClearAndResetAmaGDK()
|
|
220
|
+
{
|
|
221
|
+
Forbidden.DestroyAndReset();
|
|
222
|
+
UnloadAndGC();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private static void UnloadAndGC(){
|
|
226
|
+
Resources.UnloadUnusedAssets();
|
|
227
|
+
GC.Collect(2, GCCollectionMode.Forced, true);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
using System.Collections;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using NUnit.Framework;
|
|
6
|
+
using UnityEngine.TestTools;
|
|
7
|
+
using Amanotes.Core;
|
|
8
|
+
using Amanotes.Core.Internal;
|
|
9
|
+
using static Amanotes.Core.AmaGDK.Analytics;
|
|
10
|
+
|
|
11
|
+
public class MigrationTest
|
|
12
|
+
{
|
|
13
|
+
static List<string> lsFunnelEvents = new List<string>() { "fn_1", "fn_2", "fn_3" };
|
|
14
|
+
static List<string> lsFunnelEvents2 = new List<string>() { "fn_1", "fn_2", "fn_3", "fn_4" };
|
|
15
|
+
static Dictionary<string, int> dicEventCount = new Dictionary<string, int>() {
|
|
16
|
+
{"event_1", 1 },
|
|
17
|
+
{"event_2", 2 },
|
|
18
|
+
{"event_3", 3 },
|
|
19
|
+
};
|
|
20
|
+
static string fileName = typeof(AmaGDK.Analytics.AnalyticsData).Name;
|
|
21
|
+
static string path = FileUtils.GetPath(fileName);
|
|
22
|
+
static AnalyticsData analyticsData = AmaGDK.Analytics.localData;
|
|
23
|
+
|
|
24
|
+
[SetUp]
|
|
25
|
+
public void Setup()
|
|
26
|
+
{
|
|
27
|
+
ClearAnalyticsData();
|
|
28
|
+
AmaGDK.Init();
|
|
29
|
+
AmaGDK.Config.common.checkMigrationIntegrity = true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[Test]
|
|
33
|
+
public void Migrate_First_Time()
|
|
34
|
+
{
|
|
35
|
+
ClearAnalyticsData();
|
|
36
|
+
AmaGDK.Analytics.Migrate(lsFunnelEvents, dicEventCount);
|
|
37
|
+
Assert.IsTrue(File.Exists(path));
|
|
38
|
+
Debug.Log($"Migration count: {analyticsData.migrationLog.count}");
|
|
39
|
+
Assert.IsTrue(analyticsData.migrationLog.count == 1);
|
|
40
|
+
Assert.IsTrue(analyticsData.funnelSignatures.Count == lsFunnelEvents.Count);
|
|
41
|
+
Assert.IsTrue(analyticsData.eventDetails.Count == dicEventCount.Count);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[UnityTest]
|
|
45
|
+
public IEnumerator Migrate_Second_Time()
|
|
46
|
+
{
|
|
47
|
+
FakeAnalyticsDataFile(1);
|
|
48
|
+
Debug.Log($"Count before migration: {analyticsData.migrationLog.count}");
|
|
49
|
+
AmaGDK.Analytics.Migrate(lsFunnelEvents2, dicEventCount);
|
|
50
|
+
Assert.IsTrue(File.Exists(path));
|
|
51
|
+
Debug.Log($"Count after migration: {analyticsData.migrationLog.count}");
|
|
52
|
+
Assert.IsTrue(analyticsData.migrationLog.count == 2);
|
|
53
|
+
Assert.IsTrue(analyticsData.funnelSignatures.Count == lsFunnelEvents2.Count);
|
|
54
|
+
Assert.IsTrue(analyticsData.eventDetails.Count == (dicEventCount.Count + 1)); // 1 more event is migration_error
|
|
55
|
+
|
|
56
|
+
yield return AssertErrorEvent();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[UnityTest]
|
|
60
|
+
public IEnumerator Migrate_Third_Time()
|
|
61
|
+
{
|
|
62
|
+
FakeAnalyticsDataFile(2, 1);
|
|
63
|
+
Debug.Log($"Count before migration: {analyticsData.migrationLog.count}");
|
|
64
|
+
AmaGDK.Analytics.Migrate(lsFunnelEvents2, dicEventCount);
|
|
65
|
+
Assert.IsTrue(File.Exists(path));
|
|
66
|
+
Debug.Log($"Count after migration: {analyticsData.migrationLog.count}");
|
|
67
|
+
Assert.IsTrue(analyticsData.migrationLog.count == 3);
|
|
68
|
+
Assert.IsTrue(analyticsData.funnelSignatures.Count == lsFunnelEvents2.Count);
|
|
69
|
+
Assert.IsTrue(analyticsData.eventDetails.Count == (dicEventCount.Count + 1)); // 1 more event is migration_error
|
|
70
|
+
|
|
71
|
+
yield return AssertErrorEvent();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[UnityTest]
|
|
75
|
+
public IEnumerator Call_Migration_MultipleTimes()
|
|
76
|
+
{
|
|
77
|
+
for (int i = 0; i < 3; i++)
|
|
78
|
+
{
|
|
79
|
+
AmaGDK.Analytics.Migrate(lsFunnelEvents, dicEventCount);
|
|
80
|
+
Assert.IsTrue(File.Exists(path));
|
|
81
|
+
Debug.Log($"Migration count: {analyticsData.migrationLog.count}");
|
|
82
|
+
Assert.IsTrue(analyticsData.migrationLog.count == 1);
|
|
83
|
+
Assert.IsTrue(analyticsData.funnelSignatures.Count == lsFunnelEvents.Count);
|
|
84
|
+
Assert.IsTrue(analyticsData.eventDetails.Count == dicEventCount.Count);
|
|
85
|
+
yield return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[Test]
|
|
90
|
+
public void Call_Migration_Without_IntegrityCheck()
|
|
91
|
+
{
|
|
92
|
+
FakeAnalyticsDataFile(1);
|
|
93
|
+
AmaGDK.Config.common.checkMigrationIntegrity = false;
|
|
94
|
+
AmaGDK.Analytics.Migrate(lsFunnelEvents2, dicEventCount);
|
|
95
|
+
Assert.IsTrue(File.Exists(path));
|
|
96
|
+
Debug.Log($"Migration count: {analyticsData.migrationLog.count}");
|
|
97
|
+
Assert.IsTrue(analyticsData.migrationLog.count == 1);
|
|
98
|
+
Assert.IsTrue(analyticsData.funnelSignatures.Count == lsFunnelEvents.Count);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
//Utils
|
|
102
|
+
private static void ClearAnalyticsData()
|
|
103
|
+
{
|
|
104
|
+
string fileName = typeof(AmaGDK.Analytics.AnalyticsData).Name;
|
|
105
|
+
string path = FileUtils.GetPath(fileName);
|
|
106
|
+
FileUtils.Delete(fileName);
|
|
107
|
+
Assert.IsFalse(File.Exists(path));
|
|
108
|
+
|
|
109
|
+
analyticsData.funnelSignatures.Clear();
|
|
110
|
+
analyticsData.eventDetails.Clear();
|
|
111
|
+
analyticsData.migrationLog = new AmaGDK.Analytics.MigrationLog();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private static void FakeAnalyticsDataFile(int migrationCount, int migrationError = 0)
|
|
115
|
+
{
|
|
116
|
+
foreach (var e in lsFunnelEvents)
|
|
117
|
+
{
|
|
118
|
+
analyticsData.AddFunnelSignature(e);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
foreach (var e in dicEventCount)
|
|
122
|
+
{
|
|
123
|
+
analyticsData.eventDetails.Add(new EventDetail
|
|
124
|
+
{
|
|
125
|
+
eventName = e.Key,
|
|
126
|
+
count = e.Value
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (migrationCount > 0)
|
|
131
|
+
{
|
|
132
|
+
analyticsData.eventDetails.Add(new EventDetail
|
|
133
|
+
{
|
|
134
|
+
eventName = "migration_error",
|
|
135
|
+
count = migrationError
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
analyticsData.migrationLog = new MigrationLog()
|
|
140
|
+
{
|
|
141
|
+
deviceId = SystemInfo.deviceUniqueIdentifier,
|
|
142
|
+
appVersion = Application.version,
|
|
143
|
+
amaGDKVersion = AmaGDK.VERSION,
|
|
144
|
+
count = migrationCount
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
analyticsData.SaveIfDirty();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
IEnumerator AssertErrorEvent()
|
|
151
|
+
{
|
|
152
|
+
yield return null;
|
|
153
|
+
string errEventName = "migration_error";
|
|
154
|
+
var eventDetail = analyticsData.GetEventDetail(errEventName);
|
|
155
|
+
if (eventDetail != null)
|
|
156
|
+
{
|
|
157
|
+
Assert.IsTrue(eventDetail.count == 1);
|
|
158
|
+
}
|
|
159
|
+
else
|
|
160
|
+
{
|
|
161
|
+
var eventParams = eventQueue.Peek();
|
|
162
|
+
Assert.IsTrue(eventParams.eventName == errEventName);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!29 &1
|
|
4
|
+
OcclusionCullingSettings:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
serializedVersion: 2
|
|
7
|
+
m_OcclusionBakeSettings:
|
|
8
|
+
smallestOccluder: 5
|
|
9
|
+
smallestHole: 0.25
|
|
10
|
+
backfaceThreshold: 100
|
|
11
|
+
m_SceneGUID: 00000000000000000000000000000000
|
|
12
|
+
m_OcclusionCullingData: {fileID: 0}
|
|
13
|
+
--- !u!104 &2
|
|
14
|
+
RenderSettings:
|
|
15
|
+
m_ObjectHideFlags: 0
|
|
16
|
+
serializedVersion: 9
|
|
17
|
+
m_Fog: 0
|
|
18
|
+
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
|
19
|
+
m_FogMode: 3
|
|
20
|
+
m_FogDensity: 0.01
|
|
21
|
+
m_LinearFogStart: 0
|
|
22
|
+
m_LinearFogEnd: 300
|
|
23
|
+
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
|
24
|
+
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
|
25
|
+
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
|
26
|
+
m_AmbientIntensity: 1
|
|
27
|
+
m_AmbientMode: 0
|
|
28
|
+
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
|
29
|
+
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
|
30
|
+
m_HaloStrength: 0.5
|
|
31
|
+
m_FlareStrength: 1
|
|
32
|
+
m_FlareFadeSpeed: 3
|
|
33
|
+
m_HaloTexture: {fileID: 0}
|
|
34
|
+
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
|
35
|
+
m_DefaultReflectionMode: 0
|
|
36
|
+
m_DefaultReflectionResolution: 128
|
|
37
|
+
m_ReflectionBounces: 1
|
|
38
|
+
m_ReflectionIntensity: 1
|
|
39
|
+
m_CustomReflection: {fileID: 0}
|
|
40
|
+
m_Sun: {fileID: 0}
|
|
41
|
+
m_IndirectSpecularColor: {r: 0.7431153, g: 0.7385969, b: 0.73850554, a: 1}
|
|
42
|
+
m_UseRadianceAmbientProbe: 0
|
|
43
|
+
--- !u!157 &3
|
|
44
|
+
LightmapSettings:
|
|
45
|
+
m_ObjectHideFlags: 0
|
|
46
|
+
serializedVersion: 12
|
|
47
|
+
m_GIWorkflowMode: 1
|
|
48
|
+
m_GISettings:
|
|
49
|
+
serializedVersion: 2
|
|
50
|
+
m_BounceScale: 1
|
|
51
|
+
m_IndirectOutputScale: 1
|
|
52
|
+
m_AlbedoBoost: 1
|
|
53
|
+
m_EnvironmentLightingMode: 0
|
|
54
|
+
m_EnableBakedLightmaps: 1
|
|
55
|
+
m_EnableRealtimeLightmaps: 0
|
|
56
|
+
m_LightmapEditorSettings:
|
|
57
|
+
serializedVersion: 12
|
|
58
|
+
m_Resolution: 2
|
|
59
|
+
m_BakeResolution: 40
|
|
60
|
+
m_AtlasSize: 1024
|
|
61
|
+
m_AO: 0
|
|
62
|
+
m_AOMaxDistance: 1
|
|
63
|
+
m_CompAOExponent: 1
|
|
64
|
+
m_CompAOExponentDirect: 0
|
|
65
|
+
m_ExtractAmbientOcclusion: 0
|
|
66
|
+
m_Padding: 2
|
|
67
|
+
m_LightmapParameters: {fileID: 0}
|
|
68
|
+
m_LightmapsBakeMode: 1
|
|
69
|
+
m_TextureCompression: 1
|
|
70
|
+
m_FinalGather: 0
|
|
71
|
+
m_FinalGatherFiltering: 1
|
|
72
|
+
m_FinalGatherRayCount: 256
|
|
73
|
+
m_ReflectionCompression: 2
|
|
74
|
+
m_MixedBakeMode: 2
|
|
75
|
+
m_BakeBackend: 1
|
|
76
|
+
m_PVRSampling: 1
|
|
77
|
+
m_PVRDirectSampleCount: 32
|
|
78
|
+
m_PVRSampleCount: 512
|
|
79
|
+
m_PVRBounces: 2
|
|
80
|
+
m_PVREnvironmentSampleCount: 256
|
|
81
|
+
m_PVREnvironmentReferencePointCount: 2048
|
|
82
|
+
m_PVRFilteringMode: 1
|
|
83
|
+
m_PVRDenoiserTypeDirect: 1
|
|
84
|
+
m_PVRDenoiserTypeIndirect: 1
|
|
85
|
+
m_PVRDenoiserTypeAO: 1
|
|
86
|
+
m_PVRFilterTypeDirect: 0
|
|
87
|
+
m_PVRFilterTypeIndirect: 0
|
|
88
|
+
m_PVRFilterTypeAO: 0
|
|
89
|
+
m_PVREnvironmentMIS: 1
|
|
90
|
+
m_PVRCulling: 1
|
|
91
|
+
m_PVRFilteringGaussRadiusDirect: 1
|
|
92
|
+
m_PVRFilteringGaussRadiusIndirect: 5
|
|
93
|
+
m_PVRFilteringGaussRadiusAO: 2
|
|
94
|
+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
|
95
|
+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
|
96
|
+
m_PVRFilteringAtrousPositionSigmaAO: 1
|
|
97
|
+
m_ExportTrainingData: 0
|
|
98
|
+
m_TrainingDataDestination: TrainingData
|
|
99
|
+
m_LightProbeSampleCountMultiplier: 4
|
|
100
|
+
m_LightingDataAsset: {fileID: 0}
|
|
101
|
+
m_LightingSettings: {fileID: 0}
|
|
102
|
+
--- !u!196 &4
|
|
103
|
+
NavMeshSettings:
|
|
104
|
+
serializedVersion: 2
|
|
105
|
+
m_ObjectHideFlags: 0
|
|
106
|
+
m_BuildSettings:
|
|
107
|
+
serializedVersion: 2
|
|
108
|
+
agentTypeID: 0
|
|
109
|
+
agentRadius: 0.5
|
|
110
|
+
agentHeight: 2
|
|
111
|
+
agentSlope: 45
|
|
112
|
+
agentClimb: 0.4
|
|
113
|
+
ledgeDropHeight: 0
|
|
114
|
+
maxJumpAcrossDistance: 0
|
|
115
|
+
minRegionArea: 2
|
|
116
|
+
manualCellSize: 0
|
|
117
|
+
cellSize: 0.16666667
|
|
118
|
+
manualTileSize: 0
|
|
119
|
+
tileSize: 256
|
|
120
|
+
accuratePlacement: 0
|
|
121
|
+
maxJobWorkers: 0
|
|
122
|
+
preserveTilesOutsideBounds: 0
|
|
123
|
+
debug:
|
|
124
|
+
m_Flags: 0
|
|
125
|
+
m_NavMeshData: {fileID: 0}
|