app.hypergames.hypersdk 1.1.3 → 1.1.6
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 +21 -0
- package/Editor/Scripts/Setup/HyperSDKInstaller.cs +111 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.1.6](https://github.com/mvmhyper/hyper-sdk/compare/v1.1.5...v1.1.6) (2025-11-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update releaserc.json ([b99f90c](https://github.com/mvmhyper/hyper-sdk/commit/b99f90c0f4e309fd95f83013fb370e66b0144cad))
|
|
7
|
+
|
|
8
|
+
## [1.1.5](https://github.com/mvmhyper/hyper-sdk/compare/v1.1.4...v1.1.5) (2025-11-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* hyperloader scene tweaks ([0ca177e](https://github.com/mvmhyper/hyper-sdk/commit/0ca177ed15e4df257006684b7c7c2dfa5b8225d3))
|
|
14
|
+
|
|
15
|
+
## [1.1.4](https://github.com/mvmhyper/hyper-sdk/compare/v1.1.3...v1.1.4) (2025-11-25)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add HyperSDK installer to copy HyperLoader scene and WebGL template to Assets on package install ([d8d6643](https://github.com/mvmhyper/hyper-sdk/commit/d8d66433b0a3ffd755c73286811e62109e114995))
|
|
21
|
+
|
|
1
22
|
# [1.1.3](https://github.com/mvmhyper/hyper-sdk/compare/v1.1.2...v1.1.3) (2025-11-25)
|
|
2
23
|
|
|
3
24
|
### Bug Fixes
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
using System.IO;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.PackageManager;
|
|
4
|
+
|
|
5
|
+
namespace HyperSDK.Editor
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Ensures developer facing assets that must live in the project (not inside the package)
|
|
9
|
+
/// are copied into Assets/ so they can be edited or extended.
|
|
10
|
+
/// </summary>
|
|
11
|
+
[InitializeOnLoad]
|
|
12
|
+
internal static class HyperSDKInstaller
|
|
13
|
+
{
|
|
14
|
+
private const string InstallerPrefsKey = "HyperSDKInstaller.LastInstalledVersion";
|
|
15
|
+
private const string HyperLoaderSceneRelativePath = "HyperLoader.unity";
|
|
16
|
+
private const string HyperLoaderSceneDestination = "Assets/HyperSDK/Scenes/HyperLoader.unity";
|
|
17
|
+
private const string WebGLTemplateRelativePath = "WebGLTemplates/HyperLoader";
|
|
18
|
+
private const string WebGLTemplateDestination = "Assets/WebGLTemplates/HyperLoader";
|
|
19
|
+
|
|
20
|
+
static HyperSDKInstaller()
|
|
21
|
+
{
|
|
22
|
+
EditorApplication.delayCall += EnsureSetupAssets;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private static void EnsureSetupAssets()
|
|
26
|
+
{
|
|
27
|
+
var packageInfo = PackageInfo.FindForAssembly(typeof(HyperSDKInstaller).Assembly);
|
|
28
|
+
if (packageInfo == null || string.IsNullOrEmpty(packageInfo.resolvedPath))
|
|
29
|
+
{
|
|
30
|
+
// Skip in SDK dev mode (when running from Assets/HyperSDK instead of Packages/)
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Skip if resolvedPath points to Assets/ (dev mode) instead of Packages/ (installed package)
|
|
35
|
+
if (!packageInfo.resolvedPath.Contains("Packages"))
|
|
36
|
+
{
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var previousVersion = EditorPrefs.GetString(InstallerPrefsKey, string.Empty);
|
|
41
|
+
var sceneExists = File.Exists(HyperLoaderSceneDestination);
|
|
42
|
+
var templateExists = Directory.Exists(WebGLTemplateDestination);
|
|
43
|
+
|
|
44
|
+
if (previousVersion == packageInfo.version && sceneExists && templateExists)
|
|
45
|
+
{
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var packageRoot = packageInfo.resolvedPath;
|
|
50
|
+
var hyperLoaderSource = Path.Combine(packageRoot, HyperLoaderSceneRelativePath);
|
|
51
|
+
var templateSource = Path.Combine(packageRoot, WebGLTemplateRelativePath);
|
|
52
|
+
|
|
53
|
+
try
|
|
54
|
+
{
|
|
55
|
+
CopyScene(hyperLoaderSource);
|
|
56
|
+
CopyTemplate(templateSource);
|
|
57
|
+
|
|
58
|
+
EditorPrefs.SetString(InstallerPrefsKey, packageInfo.version);
|
|
59
|
+
AssetDatabase.Refresh();
|
|
60
|
+
}
|
|
61
|
+
catch (IOException ioException)
|
|
62
|
+
{
|
|
63
|
+
UnityEngine.Debug.LogWarning($"HyperSDK Installer: failed to copy setup assets. {ioException.Message}");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private static void CopyScene(string sourcePath)
|
|
68
|
+
{
|
|
69
|
+
if (!File.Exists(sourcePath))
|
|
70
|
+
{
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var destinationDir = Path.GetDirectoryName(HyperLoaderSceneDestination);
|
|
75
|
+
if (!string.IsNullOrEmpty(destinationDir))
|
|
76
|
+
{
|
|
77
|
+
Directory.CreateDirectory(destinationDir);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
FileUtil.CopyFileOrDirectory(sourcePath, HyperLoaderSceneDestination);
|
|
81
|
+
|
|
82
|
+
var sourceMeta = $"{sourcePath}.meta";
|
|
83
|
+
if (File.Exists(sourceMeta))
|
|
84
|
+
{
|
|
85
|
+
FileUtil.CopyFileOrDirectory(sourceMeta, $"{HyperLoaderSceneDestination}.meta");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private static void CopyTemplate(string sourceDirectory)
|
|
90
|
+
{
|
|
91
|
+
if (!Directory.Exists(sourceDirectory))
|
|
92
|
+
{
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var destinationDir = Path.GetDirectoryName(WebGLTemplateDestination);
|
|
97
|
+
if (!string.IsNullOrEmpty(destinationDir))
|
|
98
|
+
{
|
|
99
|
+
Directory.CreateDirectory(destinationDir);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (Directory.Exists(WebGLTemplateDestination))
|
|
103
|
+
{
|
|
104
|
+
FileUtil.DeleteFileOrDirectory(WebGLTemplateDestination);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
FileUtil.CopyFileOrDirectory(sourceDirectory, WebGLTemplateDestination);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"displayName": "HyperSDK",
|
|
5
5
|
"description": "Official Unity SDK for HyperGames platform. Provides seamless integration for WebGL game development with built-in support for multiplayer battles, score submission, tutorial systems, and platform-specific optimizations. Includes comprehensive editor tools for build automation, RNG migration, and WebGL configuration.",
|
|
6
6
|
"unity": "6000.0",
|