com.backnd.database 0.0.3 → 0.0.5
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 +1 -1
- package/Editor/PackageAssetInstaller.cs +39 -0
- package/LICENSE +21 -0
- package/LICENSE.meta +7 -0
- package/package.json +2 -2
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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 backnd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/LICENSE.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.5",
|
|
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",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"com.unity.nuget.newtonsoft-json": "3.2.2",
|
|
15
|
-
"com.backnd.tools": "0.0.
|
|
15
|
+
"com.backnd.tools": "0.0.2"
|
|
16
16
|
},
|
|
17
17
|
"category": "SDK",
|
|
18
18
|
"author": {
|