com.backnd.database 0.0.3 → 0.0.4
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/BACKND.Database.asmdef
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using UnityEngine;
|
|
2
2
|
using UnityEditor;
|
|
3
3
|
using UnityEditor.PackageManager;
|
|
4
|
+
using UnityEditor.Build;
|
|
4
5
|
using System.IO;
|
|
5
6
|
|
|
6
7
|
namespace BACKND.Database.Editor
|
|
@@ -11,6 +12,7 @@ namespace BACKND.Database.Editor
|
|
|
11
12
|
private const string PackageName = "com.backnd.database";
|
|
12
13
|
private const string SourceFolderName = "TheBackend~";
|
|
13
14
|
private const string TargetFolderName = "TheBackend";
|
|
15
|
+
private const string DefineSymbol = "BACKND_SDK_INSTALLED";
|
|
14
16
|
|
|
15
17
|
static PackageAssetInstaller()
|
|
16
18
|
{
|
|
@@ -24,6 +26,8 @@ namespace BACKND.Database.Editor
|
|
|
24
26
|
// 이미 설치 완료된 경우
|
|
25
27
|
if (IsAlreadyInstalled(targetPath))
|
|
26
28
|
{
|
|
29
|
+
// 파일은 있지만 심볼이 없는 경우 심볼만 추가
|
|
30
|
+
EnsureScriptingDefineSymbol();
|
|
27
31
|
return;
|
|
28
32
|
}
|
|
29
33
|
|
|
@@ -40,6 +44,17 @@ namespace BACKND.Database.Editor
|
|
|
40
44
|
InstallAssets(sourcePath, targetPath);
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
private static void EnsureScriptingDefineSymbol()
|
|
48
|
+
{
|
|
49
|
+
var buildTarget = NamedBuildTarget.FromBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
|
50
|
+
string defines = PlayerSettings.GetScriptingDefineSymbols(buildTarget);
|
|
51
|
+
|
|
52
|
+
if (!defines.Contains(DefineSymbol))
|
|
53
|
+
{
|
|
54
|
+
AddScriptingDefineSymbol();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
43
58
|
private static bool IsAlreadyInstalled(string targetPath)
|
|
44
59
|
{
|
|
45
60
|
if (!Directory.Exists(targetPath))
|
|
@@ -112,6 +127,9 @@ namespace BACKND.Database.Editor
|
|
|
112
127
|
|
|
113
128
|
AssetDatabase.Refresh();
|
|
114
129
|
|
|
130
|
+
// 스크립팅 심볼 추가 (BACKND.Database 어셈블리 컴파일 활성화)
|
|
131
|
+
AddScriptingDefineSymbol();
|
|
132
|
+
|
|
115
133
|
EditorUtility.ClearProgressBar();
|
|
116
134
|
|
|
117
135
|
Debug.Log($"[BACKND Database] 플러그인이 설치되었습니다: {targetPath}");
|
|
@@ -129,6 +147,27 @@ namespace BACKND.Database.Editor
|
|
|
129
147
|
}
|
|
130
148
|
}
|
|
131
149
|
|
|
150
|
+
private static void AddScriptingDefineSymbol()
|
|
151
|
+
{
|
|
152
|
+
var buildTarget = NamedBuildTarget.FromBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
|
153
|
+
string defines = PlayerSettings.GetScriptingDefineSymbols(buildTarget);
|
|
154
|
+
|
|
155
|
+
if (!defines.Contains(DefineSymbol))
|
|
156
|
+
{
|
|
157
|
+
if (string.IsNullOrEmpty(defines))
|
|
158
|
+
{
|
|
159
|
+
defines = DefineSymbol;
|
|
160
|
+
}
|
|
161
|
+
else
|
|
162
|
+
{
|
|
163
|
+
defines = defines + ";" + DefineSymbol;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
PlayerSettings.SetScriptingDefineSymbols(buildTarget, defines);
|
|
167
|
+
Debug.Log($"[BACKND Database] 스크립팅 심볼 추가됨: {DefineSymbol}");
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
132
171
|
private static void CopyDirectory(string sourceDir, string targetDir)
|
|
133
172
|
{
|
|
134
173
|
var dir = new DirectoryInfo(sourceDir);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.backnd.database",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"displayName": "BACKND Database",
|
|
5
5
|
"description": "BACKND Database is a Unity SDK for seamless integration with BACKND cloud database services.\n\nEasily manage and synchronize game data such as player profiles, game states, and leaderboards across multiple platforms.\nIdeal for Unity developers looking to implement robust database solutions without complex backend setups.",
|
|
6
6
|
"unity": "2021.3",
|