com.backnd.database 0.0.2 → 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,9 +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";
|
|
14
|
-
|
|
15
|
-
private const string InstalledPrefsKey = "BACKND_Database_PluginsInstalled";
|
|
16
|
-
private const string SkippedPrefsKey = "BACKND_Database_PluginsSkipped";
|
|
15
|
+
private const string DefineSymbol = "BACKND_SDK_INSTALLED";
|
|
17
16
|
|
|
18
17
|
static PackageAssetInstaller()
|
|
19
18
|
{
|
|
@@ -22,20 +21,13 @@ namespace BACKND.Database.Editor
|
|
|
22
21
|
|
|
23
22
|
private static void TryInstallAssets()
|
|
24
23
|
{
|
|
25
|
-
// 이미 설치 완료 또는 스킵한 경우
|
|
26
|
-
if (EditorPrefs.GetBool(InstalledPrefsKey, false) ||
|
|
27
|
-
EditorPrefs.GetBool(SkippedPrefsKey, false))
|
|
28
|
-
{
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
24
|
string targetPath = Path.Combine("Assets", TargetFolderName);
|
|
33
25
|
|
|
34
|
-
// 이미
|
|
35
|
-
// 핵심 파일들이 모두 존재하는지 확인
|
|
26
|
+
// 이미 설치 완료된 경우
|
|
36
27
|
if (IsAlreadyInstalled(targetPath))
|
|
37
28
|
{
|
|
38
|
-
|
|
29
|
+
// 파일은 있지만 심볼이 없는 경우 심볼만 추가
|
|
30
|
+
EnsureScriptingDefineSymbol();
|
|
39
31
|
return;
|
|
40
32
|
}
|
|
41
33
|
|
|
@@ -48,28 +40,18 @@ namespace BACKND.Database.Editor
|
|
|
48
40
|
return;
|
|
49
41
|
}
|
|
50
42
|
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
switch (result)
|
|
43
|
+
// 자동 설치
|
|
44
|
+
InstallAssets(sourcePath, targetPath);
|
|
45
|
+
}
|
|
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))
|
|
63
53
|
{
|
|
64
|
-
|
|
65
|
-
InstallAssets(sourcePath, targetPath);
|
|
66
|
-
break;
|
|
67
|
-
case 1: // 나중에
|
|
68
|
-
// 다음 에디터 실행 시 다시 물음
|
|
69
|
-
break;
|
|
70
|
-
case 2: // 다시 묻지 않기
|
|
71
|
-
EditorPrefs.SetBool(SkippedPrefsKey, true);
|
|
72
|
-
break;
|
|
54
|
+
AddScriptingDefineSymbol();
|
|
73
55
|
}
|
|
74
56
|
}
|
|
75
57
|
|
|
@@ -145,17 +127,11 @@ namespace BACKND.Database.Editor
|
|
|
145
127
|
|
|
146
128
|
AssetDatabase.Refresh();
|
|
147
129
|
|
|
148
|
-
|
|
130
|
+
// 스크립팅 심볼 추가 (BACKND.Database 어셈블리 컴파일 활성화)
|
|
131
|
+
AddScriptingDefineSymbol();
|
|
149
132
|
|
|
150
133
|
EditorUtility.ClearProgressBar();
|
|
151
134
|
|
|
152
|
-
EditorUtility.DisplayDialog(
|
|
153
|
-
"BACKND Database",
|
|
154
|
-
"플러그인 설치가 완료되었습니다!\n\n" +
|
|
155
|
-
$"설치 위치: {targetPath}",
|
|
156
|
-
"확인"
|
|
157
|
-
);
|
|
158
|
-
|
|
159
135
|
Debug.Log($"[BACKND Database] 플러그인이 설치되었습니다: {targetPath}");
|
|
160
136
|
}
|
|
161
137
|
catch (System.Exception e)
|
|
@@ -171,6 +147,27 @@ namespace BACKND.Database.Editor
|
|
|
171
147
|
}
|
|
172
148
|
}
|
|
173
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
|
+
|
|
174
171
|
private static void CopyDirectory(string sourceDir, string targetDir)
|
|
175
172
|
{
|
|
176
173
|
var dir = new DirectoryInfo(sourceDir);
|
|
@@ -205,7 +202,7 @@ namespace BACKND.Database.Editor
|
|
|
205
202
|
}
|
|
206
203
|
|
|
207
204
|
// 메뉴에서 수동 설치
|
|
208
|
-
[MenuItem("
|
|
205
|
+
[MenuItem("The Backend/Database/Install SDK Plugins")]
|
|
209
206
|
private static void ManualInstall()
|
|
210
207
|
{
|
|
211
208
|
string sourcePath = FindSourcePath();
|
|
@@ -239,13 +236,5 @@ namespace BACKND.Database.Editor
|
|
|
239
236
|
InstallAssets(sourcePath, targetPath);
|
|
240
237
|
}
|
|
241
238
|
|
|
242
|
-
// 설치 상태 초기화 (디버그용)
|
|
243
|
-
[MenuItem("BACKND/Database/Reset Install State")]
|
|
244
|
-
private static void ResetInstallState()
|
|
245
|
-
{
|
|
246
|
-
EditorPrefs.DeleteKey(InstalledPrefsKey);
|
|
247
|
-
EditorPrefs.DeleteKey(SkippedPrefsKey);
|
|
248
|
-
Debug.Log("[BACKND Database] 설치 상태가 초기화되었습니다.");
|
|
249
|
-
}
|
|
250
239
|
}
|
|
251
240
|
}
|
package/README.md.meta
ADDED
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",
|