com.amanotes.gdk 0.2.47 → 0.2.49
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 +15 -1
- package/Editor/AmaGDKEditor.cs +133 -65
- package/Editor/AmaGDKExtra.cs +31 -0
- package/Editor/AmaGDKExtra.cs.meta +11 -0
- package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs +1 -1
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/AmaGDKProject.unitypackage +0 -0
- package/Extra/SDKVersionTracking.unitypackage +0 -0
- package/Extra/SDKVersionTracking.unitypackage.meta +7 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKTest.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
- package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
- package/Packages/IronSourceAdapter.unitypackage +0 -0
- package/Packages/RevenueCatAdapter.unitypackage +0 -0
- package/Runtime/AmaGDK.Adapters.cs +0 -4
- package/Runtime/AmaGDK.Ads.cs +89 -29
- package/Runtime/AmaGDK.Analytics.cs +97 -64
- package/Runtime/AmaGDK.IAP.cs +39 -45
- package/Runtime/AmaGDK.RemoteConfig.cs +76 -52
- package/Runtime/AmaGDK.UserProfile.cs +106 -124
- package/Runtime/AmaGDK.cs +46 -35
- package/Runtime/Internal/AmaGDK.Event.cs +185 -0
- package/Runtime/Internal/AmaGDK.Event.cs.meta +3 -0
- package/Runtime/Internal/AmaGDK.Internal.cs +3 -0
- package/Runtime/Internal/AmaGDK.Utils.cs +85 -24
- package/Runtime/Klavar/Attributes/AccumulatedCountAttribute.cs +19 -0
- package/Runtime/Klavar/Attributes/AccumulatedCountAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/ConnectionAttribute.cs +18 -0
- package/Runtime/Klavar/Attributes/ConnectionAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/CountInSessionAttribute.cs +27 -0
- package/Runtime/Klavar/Attributes/CountInSessionAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/DescriptionAttribute.cs +7 -0
- package/Runtime/Klavar/Attributes/DescriptionAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/DynamicValidateAttribute.cs +30 -0
- package/Runtime/Klavar/Attributes/DynamicValidateAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/IgnoreAttribute.cs +16 -0
- package/Runtime/Klavar/Attributes/IgnoreAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/MinMaxAttribute.cs +130 -0
- package/Runtime/Klavar/Attributes/MinMaxAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/MinMaxLengthAttribute.cs +88 -0
- package/Runtime/Klavar/Attributes/MinMaxLengthAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/NameAttribute.cs +35 -0
- package/Runtime/Klavar/Attributes/NameAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/NotNullAttribute.cs +16 -0
- package/Runtime/Klavar/Attributes/NotNullAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/RegexPatternAttribute.cs +58 -0
- package/Runtime/Klavar/Attributes/RegexPatternAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/TimeDiffLastFireAttribute.cs +28 -0
- package/Runtime/Klavar/Attributes/TimeDiffLastFireAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/ToStringAttribute.cs +97 -0
- package/Runtime/Klavar/Attributes/ToStringAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes/ValueAttribute.cs +30 -0
- package/Runtime/Klavar/Attributes/ValueAttribute.cs.meta +11 -0
- package/Runtime/Klavar/Attributes.meta +8 -0
- package/Runtime/Klavar/KlavarEvent.cs +91 -0
- package/Runtime/Klavar/KlavarEvent.cs.meta +11 -0
- package/Runtime/Klavar/KlavarEventAttribute.cs +39 -0
- package/Runtime/Klavar/KlavarEventAttribute.cs.meta +11 -0
- package/Runtime/Klavar/KlavarEventTools.cs +92 -0
- package/Runtime/Klavar/KlavarEventTools.cs.meta +11 -0
- package/Runtime/Klavar/KlavarEventUtils.cs +58 -0
- package/Runtime/Klavar/KlavarEventUtils.cs.meta +11 -0
- package/Runtime/{Core.meta → Klavar.meta} +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Reflection;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
namespace Amanotes.Core
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Pretty Log Event Attribute
|
|
9
|
+
/// </summary>
|
|
10
|
+
public abstract class KlavarEventAttribute : Attribute
|
|
11
|
+
{
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// Validate Property Attribute
|
|
16
|
+
/// </summary>
|
|
17
|
+
public abstract class ValidateLogEventAttribute : KlavarEventAttribute
|
|
18
|
+
{
|
|
19
|
+
public abstract void Validate(object parent, FieldInfo fieldInfo, object param);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// Converter Value of Property Attribute
|
|
24
|
+
/// </summary>
|
|
25
|
+
public abstract class ConverterLogEventAttribute : KlavarEventAttribute
|
|
26
|
+
{
|
|
27
|
+
public abstract object Convert(object parent, FieldInfo fieldInfo, object param);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
/// Nameing Property Attribute
|
|
33
|
+
/// </summary>
|
|
34
|
+
public abstract class NamingLogEventAttribute : KlavarEventAttribute
|
|
35
|
+
{
|
|
36
|
+
public abstract string GetName(object parent, FieldInfo fieldInfo);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//
|
|
2
|
+
// #if UNITY_EDITOR
|
|
3
|
+
//
|
|
4
|
+
// using System.Linq;
|
|
5
|
+
// using System.Collections;
|
|
6
|
+
// using UnityEditor;
|
|
7
|
+
// using UnityEngine;
|
|
8
|
+
//
|
|
9
|
+
// using System.IO;
|
|
10
|
+
// using System.Collections.Generic;
|
|
11
|
+
// using System;
|
|
12
|
+
//
|
|
13
|
+
// namespace Amanotes.Core
|
|
14
|
+
// {
|
|
15
|
+
// /// <summary>
|
|
16
|
+
// /// Prety Log Event Tools
|
|
17
|
+
// /// </summary>
|
|
18
|
+
// public class KlavarEventTools
|
|
19
|
+
// {
|
|
20
|
+
// public class KlavarEventLine
|
|
21
|
+
// {
|
|
22
|
+
// public string No;
|
|
23
|
+
// public string EventName;
|
|
24
|
+
// public string EventParameterName;
|
|
25
|
+
//
|
|
26
|
+
// public string ValueType;
|
|
27
|
+
//
|
|
28
|
+
// public string ParameterValue;
|
|
29
|
+
//
|
|
30
|
+
// public bool IsInvalid()
|
|
31
|
+
// {
|
|
32
|
+
// return string.IsNullOrWhiteSpace(No)
|
|
33
|
+
// && string.IsNullOrWhiteSpace(EventName)
|
|
34
|
+
// && string.IsNullOrWhiteSpace(EventParameterName)
|
|
35
|
+
// && string.IsNullOrWhiteSpace(ValueType)
|
|
36
|
+
// && string.IsNullOrWhiteSpace(ParameterValue);
|
|
37
|
+
// }
|
|
38
|
+
// }
|
|
39
|
+
//
|
|
40
|
+
// static private IEnumerable<T[]> Chunk<T>(IEnumerable<T> colection, Func<T, bool> splitter)
|
|
41
|
+
// {
|
|
42
|
+
//
|
|
43
|
+
// IEnumerator<T> iter = colection.GetEnumerator();
|
|
44
|
+
// var running = iter.MoveNext();
|
|
45
|
+
//
|
|
46
|
+
// IEnumerable<T> OneChunk()
|
|
47
|
+
// {
|
|
48
|
+
// yield return iter.Current;
|
|
49
|
+
// while (running = iter.MoveNext())
|
|
50
|
+
// {
|
|
51
|
+
// var val = iter.Current;
|
|
52
|
+
// if (splitter(val)) break;
|
|
53
|
+
// yield return val;
|
|
54
|
+
// }
|
|
55
|
+
// }
|
|
56
|
+
//
|
|
57
|
+
// while (running)
|
|
58
|
+
// {
|
|
59
|
+
// var chunk = OneChunk().ToArray();
|
|
60
|
+
// if (chunk.Length > 0) yield return chunk;
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
63
|
+
//
|
|
64
|
+
//
|
|
65
|
+
// static void ConvertFromCSV()
|
|
66
|
+
// {
|
|
67
|
+
//
|
|
68
|
+
// // string path = EditorUtility.OpenFilePanel("Overwrite with png", ".", "tsv");
|
|
69
|
+
//
|
|
70
|
+
// var path = "/Users/nam.dn/Downloads/Test Pretty Event - Ad Mon.tsv";
|
|
71
|
+
// if (string.IsNullOrEmpty(path)) return;
|
|
72
|
+
//
|
|
73
|
+
//
|
|
74
|
+
// Debug.Log(path);
|
|
75
|
+
// string text = File.ReadAllText(path);
|
|
76
|
+
// var lines = Amanotes.Klavar.TSVParser
|
|
77
|
+
// .Parse<KlavarEventLine>(text)
|
|
78
|
+
// .Where(line => !line.IsInvalid());
|
|
79
|
+
//
|
|
80
|
+
// var linesEvents = Chunk(lines, line => !string.IsNullOrEmpty(line.No));
|
|
81
|
+
// foreach (var linesEvent in linesEvents)
|
|
82
|
+
// {
|
|
83
|
+
// Debug.Log(linesEvent[0]);
|
|
84
|
+
// Debug.Log(linesEvent.Length);
|
|
85
|
+
//
|
|
86
|
+
// var linesParams = Chunk(lines, line => !string.IsNullOrEmpty(line.EventParameterName));
|
|
87
|
+
//
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
// }
|
|
92
|
+
// #endif
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Linq;
|
|
3
|
+
using System.Text.RegularExpressions;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
namespace Amanotes.Core
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Convert string to some famous case
|
|
10
|
+
/// https://dev.to/ankitmalikg/difference-among-casings-snake-case-vs-camel-case-vs-pascal-case-vs-kebab-case-2m8b#:~:text=Pascal%20Case%20is%20similar%20to,C%23%2C%20Java%2C%20and%20TypeScript.
|
|
11
|
+
/// </summary>
|
|
12
|
+
internal class KlavarEventUtils
|
|
13
|
+
{
|
|
14
|
+
private static readonly char[] delimiters = { '-', '_', ' ' };
|
|
15
|
+
// private static readonly string delimiters = "_- ";
|
|
16
|
+
public static string[] ToTokens(string text)
|
|
17
|
+
{
|
|
18
|
+
text = Regex.Replace(text, "([A-Z])", " $1");
|
|
19
|
+
var tokens = text.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
|
|
20
|
+
return tokens;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
public static string ToLowerCase(string text) => text.ToLower();
|
|
25
|
+
|
|
26
|
+
public static string ToUpperCase(string text) => text.ToUpper();
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
/// Convert string to SnakeCase
|
|
30
|
+
/// </summary>
|
|
31
|
+
/// <param name="text"></param>
|
|
32
|
+
/// <returns></returns>
|
|
33
|
+
public static string ToSnakeCase(string text)
|
|
34
|
+
{
|
|
35
|
+
var tokens = ToTokens(text);
|
|
36
|
+
return string.Join("_", tokens.Select(t => t.ToLower()));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public static string ToCamelCase(string text)
|
|
40
|
+
{
|
|
41
|
+
var tokens = ToTokens(text);
|
|
42
|
+
return string.Join("", tokens.Select(t => Char.ToUpper(t[0]) + t.Substring(1).ToLower()));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public static string ToPascalCase(string text)
|
|
46
|
+
{
|
|
47
|
+
var tokens = ToTokens(text);
|
|
48
|
+
return string.Join("", tokens.Select((t, i) =>
|
|
49
|
+
(i == 0 ? Char.ToLower(t[0]) : Char.ToUpper(t[0])) + t.Substring(1).ToLower()));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static string ToKebabCase(string text)
|
|
53
|
+
{
|
|
54
|
+
var tokens = ToTokens(text);
|
|
55
|
+
return string.Join("-", tokens.Select(t => t.ToLower()));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|