app.hypergames.hypersdk 1.3.4 → 1.4.1
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 -0
- package/Editor/{HyperSDK.Editor.asmdef → Hyper.Editor.asmdef} +1 -1
- package/Editor/Resources/ControlBarPreviews/Dark/Default.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Dark/Default.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HealthBarLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HealthBarLeft.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HeartsLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HeartsLeft.png.meta +169 -0
- package/Editor/Resources/ControlBarPreviews/Dark.meta +8 -0
- package/Editor/Resources/ControlBarPreviews/Light/Default.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Light/Default.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Light/HealthBarLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Light/HealthBarLeft.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Light/HeartsLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Light/HeartsLeft.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Light.meta +8 -0
- package/Editor/Resources/ControlBarPreviews.meta +8 -0
- package/Editor/Scripts/Inspectors/HyperSDKSettingsEditor.cs +206 -0
- package/Editor/Scripts/Inspectors/HyperSDKSettingsEditor.cs.meta +2 -0
- package/Editor/Scripts/Inspectors.meta +8 -0
- package/Editor/Scripts/Tools/HyperBuildAssistant.cs +53 -3
- package/Editor/Scripts/Windows/HyperCoreSettingsWindow.cs +0 -8
- package/Editor/Scripts/Windows/HyperGameContentWindow.cs +0 -8
- package/Editor/Scripts/Windows/HyperSettingsWindow.cs +3 -3
- package/HyperLoader.unity +4 -49
- package/Runtime/Internal/AssemblyInfo.cs +1 -1
- package/Runtime/Internal/Managers/EventManager.cs +4 -0
- package/Runtime/Internal/Managers/GameManager.cs +173 -5
- package/Runtime/Internal/ScriptableObjects/HyperSDKSettings.cs +16 -10
- package/Runtime/Internal/UI/Animation/BlinkingText.cs +1 -1
- package/Runtime/Internal/UI/Animation/HyperTween.cs +88 -0
- package/Runtime/Internal/UI/Components/ControlBar.cs +220 -40
- package/Runtime/Internal/UI/Components/HealthBarDisplay.cs +269 -0
- package/Runtime/Internal/UI/Components/HealthBarDisplay.cs.meta +2 -0
- package/Runtime/Internal/UI/Components/LivesDisplay.cs +327 -0
- package/Runtime/Internal/UI/Components/LivesDisplay.cs.meta +2 -0
- package/Runtime/Internal/UI/Modals/ExitGameMenuModal.cs +46 -0
- package/Runtime/Internal/UI/Modals/ExitGameMenuModal.cs.meta +11 -0
- package/Runtime/Internal/UI/Modals/StartingInstructionModal.cs +202 -3
- package/Runtime/Internal/Utils/HyperConstants.cs +27 -0
- package/Runtime/Public/Core/HyperSDK.cs +68 -0
- package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Hyper BIG.mat +1 -1
- package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Shadows.mat +1 -1
- package/Runtime/Resources/HyperSDKSettings.asset +3 -2
- package/Runtime/Resources/Sprites/Big Icons/Exit.png +0 -0
- package/Runtime/Resources/Sprites/Big Icons/Exit.png.meta +195 -0
- package/Runtime/Resources/Sprites/Control Bar/Ellipse 3.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Ellipse 3.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Green Fill.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Green Fill.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Underlay.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Underlay.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.empty.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.empty.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.fill.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.fill.png.meta +169 -0
- package/Runtime/Resources/Sprites/Frames/{Game Over P.png.meta → Game Over.png.meta } +4 -4
- package/Runtime/Resources/Sprites/HYPERGAMES_Logo.png.meta +3 -3
- package/Runtime/Resources/Sprites/Hyper Atlas.spriteatlasv2 +6 -0
- package/Runtime/Resources/Sprites/Start CTAs/Hand.PNG +0 -0
- package/Runtime/Resources/Sprites/Start CTAs/Hand.PNG.meta +169 -0
- package/Runtime/Resources/Sprites/Start CTAs/Line .PNG +0 -0
- package/Runtime/Resources/Sprites/Start CTAs/Line .PNG.meta +169 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture GIF.controller +130 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture GIF.controller.meta +8 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture.anim +158 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture.anim.meta +8 -0
- package/Runtime/Resources/Sprites/Start CTAs.meta +8 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Health Bar Display.prefab +361 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Health Bar Display.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Lives Display .prefab +246 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Lives Display .prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects.meta +8 -0
- package/Runtime/Resources/UIPrefabs/ControlBar.prefab +131 -17
- package/Runtime/Resources/UIPrefabs/ExitGameMenuModal.prefab +1043 -0
- package/Runtime/Resources/UIPrefabs/ExitGameMenuModal.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/GamePausedModal_Battle.prefab +1 -1
- package/Runtime/Resources/UIPrefabs/StartingInstructionModal.prefab +271 -57
- package/Runtime/Resources/UIPrefabs/TutorialLandscapeModal.prefab +1 -1
- package/Runtime/Resources/UIPrefabs/TutorialPortraitModal.prefab +1 -1
- package/Runtime/Shared/DTOs/Enums.cs +22 -6
- package/package.json +1 -1
- /package/Editor/{HyperSDK.Editor.asmdef.meta → Hyper.Editor.asmdef.meta} +0 -0
- /package/Runtime/Resources/Sprites/Frames/{Game Over P.png → Game Over.png} +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 53932163501089d4998e1c09f0667321
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 13
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 0
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
flipGreenChannel: 0
|
|
24
|
+
isReadable: 0
|
|
25
|
+
streamingMipmaps: 0
|
|
26
|
+
streamingMipmapsPriority: 0
|
|
27
|
+
vTOnly: 0
|
|
28
|
+
ignoreMipmapLimit: 0
|
|
29
|
+
grayScaleToAlpha: 0
|
|
30
|
+
generateCubemap: 6
|
|
31
|
+
cubemapConvolution: 0
|
|
32
|
+
seamlessCubemap: 0
|
|
33
|
+
textureFormat: 1
|
|
34
|
+
maxTextureSize: 2048
|
|
35
|
+
textureSettings:
|
|
36
|
+
serializedVersion: 2
|
|
37
|
+
filterMode: 1
|
|
38
|
+
aniso: 1
|
|
39
|
+
mipBias: 0
|
|
40
|
+
wrapU: 1
|
|
41
|
+
wrapV: 1
|
|
42
|
+
wrapW: 1
|
|
43
|
+
nPOTScale: 0
|
|
44
|
+
lightmap: 0
|
|
45
|
+
compressionQuality: 50
|
|
46
|
+
spriteMode: 1
|
|
47
|
+
spriteExtrude: 1
|
|
48
|
+
spriteMeshType: 1
|
|
49
|
+
alignment: 0
|
|
50
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
51
|
+
spritePixelsToUnits: 100
|
|
52
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
53
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
54
|
+
alphaUsage: 1
|
|
55
|
+
alphaIsTransparency: 1
|
|
56
|
+
spriteTessellationDetail: -1
|
|
57
|
+
textureType: 8
|
|
58
|
+
textureShape: 1
|
|
59
|
+
singleChannelComponent: 0
|
|
60
|
+
flipbookRows: 1
|
|
61
|
+
flipbookColumns: 1
|
|
62
|
+
maxTextureSizeSet: 0
|
|
63
|
+
compressionQualitySet: 0
|
|
64
|
+
textureFormatSet: 0
|
|
65
|
+
ignorePngGamma: 0
|
|
66
|
+
applyGammaDecoding: 0
|
|
67
|
+
swizzle: 50462976
|
|
68
|
+
cookieLightType: 0
|
|
69
|
+
platformSettings:
|
|
70
|
+
- serializedVersion: 4
|
|
71
|
+
buildTarget: DefaultTexturePlatform
|
|
72
|
+
maxTextureSize: 512
|
|
73
|
+
resizeAlgorithm: 0
|
|
74
|
+
textureFormat: -1
|
|
75
|
+
textureCompression: 1
|
|
76
|
+
compressionQuality: 45
|
|
77
|
+
crunchedCompression: 1
|
|
78
|
+
allowsAlphaSplitting: 0
|
|
79
|
+
overridden: 0
|
|
80
|
+
ignorePlatformSupport: 0
|
|
81
|
+
androidETC2FallbackOverride: 0
|
|
82
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
83
|
+
- serializedVersion: 4
|
|
84
|
+
buildTarget: Standalone
|
|
85
|
+
maxTextureSize: 2048
|
|
86
|
+
resizeAlgorithm: 0
|
|
87
|
+
textureFormat: 12
|
|
88
|
+
textureCompression: 1
|
|
89
|
+
compressionQuality: 50
|
|
90
|
+
crunchedCompression: 0
|
|
91
|
+
allowsAlphaSplitting: 0
|
|
92
|
+
overridden: 0
|
|
93
|
+
ignorePlatformSupport: 0
|
|
94
|
+
androidETC2FallbackOverride: 0
|
|
95
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
96
|
+
- serializedVersion: 4
|
|
97
|
+
buildTarget: WebGL
|
|
98
|
+
maxTextureSize: 2048
|
|
99
|
+
resizeAlgorithm: 0
|
|
100
|
+
textureFormat: 12
|
|
101
|
+
textureCompression: 1
|
|
102
|
+
compressionQuality: 50
|
|
103
|
+
crunchedCompression: 0
|
|
104
|
+
allowsAlphaSplitting: 0
|
|
105
|
+
overridden: 0
|
|
106
|
+
ignorePlatformSupport: 0
|
|
107
|
+
androidETC2FallbackOverride: 0
|
|
108
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
109
|
+
- serializedVersion: 4
|
|
110
|
+
buildTarget: Android
|
|
111
|
+
maxTextureSize: 256
|
|
112
|
+
resizeAlgorithm: 0
|
|
113
|
+
textureFormat: -1
|
|
114
|
+
textureCompression: 0
|
|
115
|
+
compressionQuality: 50
|
|
116
|
+
crunchedCompression: 0
|
|
117
|
+
allowsAlphaSplitting: 0
|
|
118
|
+
overridden: 0
|
|
119
|
+
ignorePlatformSupport: 0
|
|
120
|
+
androidETC2FallbackOverride: 0
|
|
121
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
122
|
+
spriteSheet:
|
|
123
|
+
serializedVersion: 2
|
|
124
|
+
sprites: []
|
|
125
|
+
outline: []
|
|
126
|
+
customData:
|
|
127
|
+
physicsShape: []
|
|
128
|
+
bones: []
|
|
129
|
+
spriteID: 5e97eb03825dee720800000000000000
|
|
130
|
+
internalID: 0
|
|
131
|
+
vertices: []
|
|
132
|
+
indices:
|
|
133
|
+
edges: []
|
|
134
|
+
weights: []
|
|
135
|
+
secondaryTextures: []
|
|
136
|
+
spriteCustomMetadata:
|
|
137
|
+
entries: []
|
|
138
|
+
nameFileIdTable: {}
|
|
139
|
+
mipmapLimitGroupName:
|
|
140
|
+
pSDRemoveMatte: 0
|
|
141
|
+
userData:
|
|
142
|
+
assetBundleName:
|
|
143
|
+
assetBundleVariant:
|
|
Binary file
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 3ba286450aea7ab4cb3566b5dc136bdd
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 13
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 0
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
flipGreenChannel: 0
|
|
24
|
+
isReadable: 0
|
|
25
|
+
streamingMipmaps: 0
|
|
26
|
+
streamingMipmapsPriority: 0
|
|
27
|
+
vTOnly: 0
|
|
28
|
+
ignoreMipmapLimit: 0
|
|
29
|
+
grayScaleToAlpha: 0
|
|
30
|
+
generateCubemap: 6
|
|
31
|
+
cubemapConvolution: 0
|
|
32
|
+
seamlessCubemap: 0
|
|
33
|
+
textureFormat: 1
|
|
34
|
+
maxTextureSize: 2048
|
|
35
|
+
textureSettings:
|
|
36
|
+
serializedVersion: 2
|
|
37
|
+
filterMode: 1
|
|
38
|
+
aniso: 1
|
|
39
|
+
mipBias: 0
|
|
40
|
+
wrapU: 1
|
|
41
|
+
wrapV: 1
|
|
42
|
+
wrapW: 1
|
|
43
|
+
nPOTScale: 0
|
|
44
|
+
lightmap: 0
|
|
45
|
+
compressionQuality: 50
|
|
46
|
+
spriteMode: 1
|
|
47
|
+
spriteExtrude: 1
|
|
48
|
+
spriteMeshType: 1
|
|
49
|
+
alignment: 0
|
|
50
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
51
|
+
spritePixelsToUnits: 100
|
|
52
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
53
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
54
|
+
alphaUsage: 1
|
|
55
|
+
alphaIsTransparency: 1
|
|
56
|
+
spriteTessellationDetail: -1
|
|
57
|
+
textureType: 8
|
|
58
|
+
textureShape: 1
|
|
59
|
+
singleChannelComponent: 0
|
|
60
|
+
flipbookRows: 1
|
|
61
|
+
flipbookColumns: 1
|
|
62
|
+
maxTextureSizeSet: 0
|
|
63
|
+
compressionQualitySet: 0
|
|
64
|
+
textureFormatSet: 0
|
|
65
|
+
ignorePngGamma: 0
|
|
66
|
+
applyGammaDecoding: 0
|
|
67
|
+
swizzle: 50462976
|
|
68
|
+
cookieLightType: 0
|
|
69
|
+
platformSettings:
|
|
70
|
+
- serializedVersion: 4
|
|
71
|
+
buildTarget: DefaultTexturePlatform
|
|
72
|
+
maxTextureSize: 512
|
|
73
|
+
resizeAlgorithm: 0
|
|
74
|
+
textureFormat: -1
|
|
75
|
+
textureCompression: 1
|
|
76
|
+
compressionQuality: 45
|
|
77
|
+
crunchedCompression: 1
|
|
78
|
+
allowsAlphaSplitting: 0
|
|
79
|
+
overridden: 0
|
|
80
|
+
ignorePlatformSupport: 0
|
|
81
|
+
androidETC2FallbackOverride: 0
|
|
82
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
83
|
+
- serializedVersion: 4
|
|
84
|
+
buildTarget: Standalone
|
|
85
|
+
maxTextureSize: 2048
|
|
86
|
+
resizeAlgorithm: 0
|
|
87
|
+
textureFormat: 12
|
|
88
|
+
textureCompression: 1
|
|
89
|
+
compressionQuality: 50
|
|
90
|
+
crunchedCompression: 0
|
|
91
|
+
allowsAlphaSplitting: 0
|
|
92
|
+
overridden: 0
|
|
93
|
+
ignorePlatformSupport: 0
|
|
94
|
+
androidETC2FallbackOverride: 0
|
|
95
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
96
|
+
- serializedVersion: 4
|
|
97
|
+
buildTarget: WebGL
|
|
98
|
+
maxTextureSize: 2048
|
|
99
|
+
resizeAlgorithm: 0
|
|
100
|
+
textureFormat: 12
|
|
101
|
+
textureCompression: 1
|
|
102
|
+
compressionQuality: 50
|
|
103
|
+
crunchedCompression: 0
|
|
104
|
+
allowsAlphaSplitting: 0
|
|
105
|
+
overridden: 0
|
|
106
|
+
ignorePlatformSupport: 0
|
|
107
|
+
androidETC2FallbackOverride: 0
|
|
108
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
109
|
+
- serializedVersion: 4
|
|
110
|
+
buildTarget: Android
|
|
111
|
+
maxTextureSize: 256
|
|
112
|
+
resizeAlgorithm: 0
|
|
113
|
+
textureFormat: -1
|
|
114
|
+
textureCompression: 0
|
|
115
|
+
compressionQuality: 50
|
|
116
|
+
crunchedCompression: 0
|
|
117
|
+
allowsAlphaSplitting: 0
|
|
118
|
+
overridden: 0
|
|
119
|
+
ignorePlatformSupport: 0
|
|
120
|
+
androidETC2FallbackOverride: 0
|
|
121
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
122
|
+
spriteSheet:
|
|
123
|
+
serializedVersion: 2
|
|
124
|
+
sprites: []
|
|
125
|
+
outline: []
|
|
126
|
+
customData:
|
|
127
|
+
physicsShape: []
|
|
128
|
+
bones: []
|
|
129
|
+
spriteID: 5e97eb03825dee720800000000000000
|
|
130
|
+
internalID: 0
|
|
131
|
+
vertices: []
|
|
132
|
+
indices:
|
|
133
|
+
edges: []
|
|
134
|
+
weights: []
|
|
135
|
+
secondaryTextures: []
|
|
136
|
+
spriteCustomMetadata:
|
|
137
|
+
entries: []
|
|
138
|
+
nameFileIdTable: {}
|
|
139
|
+
mipmapLimitGroupName:
|
|
140
|
+
pSDRemoveMatte: 0
|
|
141
|
+
userData:
|
|
142
|
+
assetBundleName:
|
|
143
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using Hyper.Internal;
|
|
5
|
+
using Hyper.Shared;
|
|
6
|
+
|
|
7
|
+
namespace Hyper.Editor
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
/// Custom editor for HyperSDKSettings that displays a preview image based on the selected layout and theme.
|
|
11
|
+
/// </summary>
|
|
12
|
+
[CustomEditor(typeof(HyperSDKSettings))]
|
|
13
|
+
internal class HyperSDKSettingsEditor : UnityEditor.Editor
|
|
14
|
+
{
|
|
15
|
+
private Texture2D _previewTexture;
|
|
16
|
+
private string _lastLayout;
|
|
17
|
+
private string _lastTheme;
|
|
18
|
+
private GUIStyle _blandLabelStyle;
|
|
19
|
+
|
|
20
|
+
private void OnEnable()
|
|
21
|
+
{
|
|
22
|
+
UpdatePreview();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private void InitializeStyles()
|
|
26
|
+
{
|
|
27
|
+
_blandLabelStyle = new GUIStyle(EditorStyles.label) { margin = new RectOffset(0, 0, 0, 0), padding = new RectOffset(0, 0, 0, 0) };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public override void OnInspectorGUI()
|
|
31
|
+
{
|
|
32
|
+
InitializeStyles();
|
|
33
|
+
|
|
34
|
+
serializedObject.Update();
|
|
35
|
+
|
|
36
|
+
HyperSDKSettings settings = (HyperSDKSettings)target;
|
|
37
|
+
|
|
38
|
+
EditorGUILayout.BeginVertical(EditorStyles.label);
|
|
39
|
+
{
|
|
40
|
+
|
|
41
|
+
// Draw Supported Orientations
|
|
42
|
+
EditorGUILayout.LabelField("Supported Orientations", EditorStyles.boldLabel);
|
|
43
|
+
|
|
44
|
+
settings.portrait = EditorGUILayout.Toggle("Portrait", settings.portrait);
|
|
45
|
+
settings.landscape = EditorGUILayout.Toggle("Landscape", settings.landscape);
|
|
46
|
+
|
|
47
|
+
// Draw Supported Platforms
|
|
48
|
+
EditorGUILayout.Space(12);
|
|
49
|
+
EditorGUILayout.LabelField("Supported Platforms", EditorStyles.boldLabel);
|
|
50
|
+
|
|
51
|
+
settings.pc = EditorGUILayout.Toggle("PC", settings.pc);
|
|
52
|
+
settings.mobile = EditorGUILayout.Toggle("Mobile", settings.mobile);
|
|
53
|
+
|
|
54
|
+
// Draw Start CTA
|
|
55
|
+
EditorGUILayout.Space(12);
|
|
56
|
+
EditorGUILayout.LabelField("Start CTA Overlay", EditorStyles.boldLabel);
|
|
57
|
+
|
|
58
|
+
settings.startCTA = (StartCTA)EditorGUILayout.EnumPopup(
|
|
59
|
+
new GUIContent("Start CTA", "Choose how players start the game. Hyper requires one of these overlays - do not add your own start buttons."),
|
|
60
|
+
settings.startCTA);
|
|
61
|
+
|
|
62
|
+
// Draw Control Bar Settings
|
|
63
|
+
EditorGUILayout.Space(12);
|
|
64
|
+
EditorGUILayout.LabelField("Control Bar Settings", EditorStyles.boldLabel);
|
|
65
|
+
|
|
66
|
+
EditorGUILayout.Space(2);
|
|
67
|
+
|
|
68
|
+
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
|
69
|
+
{
|
|
70
|
+
EditorGUILayout.LabelField("Hearts and Health Bar require calling HyperSDK.Game.InitializeLives(..) or HyperSDK.Game.InitializeHealth(..) at runtime.",
|
|
71
|
+
EditorStyles.wordWrappedMiniLabel);
|
|
72
|
+
|
|
73
|
+
var linkStyle = new GUIStyle(EditorStyles.linkLabel)
|
|
74
|
+
{
|
|
75
|
+
fontSize = 10,
|
|
76
|
+
margin = new RectOffset(0, 0, 0, 0),
|
|
77
|
+
padding = new RectOffset(2, 2, 0, 0)
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// Link-style button
|
|
81
|
+
if (GUILayout.Button("Learn more", linkStyle))
|
|
82
|
+
{
|
|
83
|
+
Application.OpenURL("https://docs-getting-started-updates.hyper-sdk-documentation.pages.dev/sdk/modules/game.html#control-bar-lives-api-hearts-layout");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Optional: make cursor look like a link when hovering
|
|
87
|
+
var rect = GUILayoutUtility.GetLastRect();
|
|
88
|
+
EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
|
|
89
|
+
}
|
|
90
|
+
EditorGUILayout.EndVertical();
|
|
91
|
+
|
|
92
|
+
EditorGUILayout.Space(2);
|
|
93
|
+
|
|
94
|
+
settings.controlBarLayout = (ControlBarLayout)EditorGUILayout.EnumPopup(
|
|
95
|
+
new GUIContent("Control Bar Layout", "Select the layout type for the in-game control bar."),
|
|
96
|
+
settings.controlBarLayout);
|
|
97
|
+
|
|
98
|
+
// Check if layout or theme changed and update preview
|
|
99
|
+
string currentLayout = settings.controlBarLayout.ToString();
|
|
100
|
+
string currentTheme = settings.controlBarTheme.ToString();
|
|
101
|
+
|
|
102
|
+
if (currentLayout != _lastLayout || currentTheme != _lastTheme)
|
|
103
|
+
{
|
|
104
|
+
_lastLayout = currentLayout;
|
|
105
|
+
_lastTheme = currentTheme;
|
|
106
|
+
UpdatePreview();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Draw preview image right after Control Bar Settings
|
|
110
|
+
EditorGUILayout.Space(-1f);
|
|
111
|
+
DrawPreviewImage();
|
|
112
|
+
|
|
113
|
+
EditorGUILayout.Space(12);
|
|
114
|
+
// Draw Editor Testing
|
|
115
|
+
SerializedProperty settingsProp = serializedObject.FindProperty("_settings");
|
|
116
|
+
if (settingsProp != null)
|
|
117
|
+
{
|
|
118
|
+
EditorGUILayout.PropertyField(settingsProp, new GUIContent("Settings", "Configuration settings for testing within the Unity Editor."), true);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
EditorGUILayout.EndVertical();
|
|
122
|
+
|
|
123
|
+
serializedObject.ApplyModifiedProperties();
|
|
124
|
+
|
|
125
|
+
// Mark object as dirty if any changes were made
|
|
126
|
+
if (GUI.changed)
|
|
127
|
+
{
|
|
128
|
+
EditorUtility.SetDirty(settings);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private void UpdatePreview()
|
|
133
|
+
{
|
|
134
|
+
HyperSDKSettings settings = (HyperSDKSettings)target;
|
|
135
|
+
if (settings == null) return;
|
|
136
|
+
|
|
137
|
+
// Get the preview image path based on layout and theme
|
|
138
|
+
string imageName = GetPreviewImageName(settings.controlBarLayout);
|
|
139
|
+
string themeFolder = settings.controlBarTheme == ControlBarTheme.Dark ? "Dark" : "Light";
|
|
140
|
+
string imagePath = $"{HyperConstants.CONTROL_BAR_PREVIEW_FOLDER_PATH}/{themeFolder}/{imageName}.png";
|
|
141
|
+
|
|
142
|
+
// Load the texture
|
|
143
|
+
_previewTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(imagePath);
|
|
144
|
+
|
|
145
|
+
if (_previewTexture == null)
|
|
146
|
+
{
|
|
147
|
+
Debug.LogWarning($"[HyperSDKSettingsEditor] Preview image not found at: {imagePath}");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
private string GetPreviewImageName(ControlBarLayout layout)
|
|
152
|
+
{
|
|
153
|
+
switch (layout)
|
|
154
|
+
{
|
|
155
|
+
case ControlBarLayout.Default:
|
|
156
|
+
return "Default";
|
|
157
|
+
case ControlBarLayout.HeartsLeft:
|
|
158
|
+
return "HeartsLeft";
|
|
159
|
+
case ControlBarLayout.HealthBarLeft:
|
|
160
|
+
return "HealthBarLeft";
|
|
161
|
+
default:
|
|
162
|
+
return "Default";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private void DrawPreviewImage()
|
|
167
|
+
{
|
|
168
|
+
if (_previewTexture == null) return;
|
|
169
|
+
|
|
170
|
+
// Draw label and preview image
|
|
171
|
+
EditorGUILayout.BeginHorizontal(_blandLabelStyle);
|
|
172
|
+
{
|
|
173
|
+
EditorGUILayout.LabelField("Control Bar Preview", _blandLabelStyle);
|
|
174
|
+
|
|
175
|
+
// Calculate preview size (maintain aspect ratio, max width 500)
|
|
176
|
+
float containterPadding = 10f;
|
|
177
|
+
float maxWidth = 320f;
|
|
178
|
+
float aspectRatio = (float)_previewTexture.height / _previewTexture.width;
|
|
179
|
+
float previewWidth = maxWidth;
|
|
180
|
+
float previewHeight = previewWidth * aspectRatio;
|
|
181
|
+
|
|
182
|
+
// Center the preview
|
|
183
|
+
Rect rect = GUILayoutUtility.GetRect(previewWidth, previewHeight, GUILayout.ExpandWidth(false));
|
|
184
|
+
rect.x = previewWidth * 0.5125f;
|
|
185
|
+
rect.y += 7.5f;
|
|
186
|
+
|
|
187
|
+
GUI.color = Color.white;
|
|
188
|
+
|
|
189
|
+
// Subtle background container
|
|
190
|
+
Color containerColor = EditorGUIUtility.isProSkin
|
|
191
|
+
? new Color(0.15f, 0.15f, 0.15f, 0.4f)
|
|
192
|
+
: new Color(0.95f, 0.95f, 0.95f, 0.6f);
|
|
193
|
+
EditorGUI.DrawRect(new Rect(rect.x - containterPadding / 2, rect.y - containterPadding / 2, rect.width + containterPadding, rect.height + containterPadding), containerColor);
|
|
194
|
+
|
|
195
|
+
GUI.color = new Color(1, 1, 1, 0.9f); // Set the color to semi-transparent white
|
|
196
|
+
|
|
197
|
+
// Draw the preview
|
|
198
|
+
GUI.DrawTexture(rect, _previewTexture, ScaleMode.ScaleToFit);
|
|
199
|
+
GUI.color = Color.white; // Reset the color
|
|
200
|
+
}
|
|
201
|
+
EditorGUILayout.EndHorizontal();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
#endif
|
|
206
|
+
|
|
@@ -581,6 +581,18 @@ namespace Hyper.Editor
|
|
|
581
581
|
};
|
|
582
582
|
CategorizeSettings(colorSpaceSetting, optimalSettings, recommendedSettings, outstandingSettings);
|
|
583
583
|
|
|
584
|
+
var buildTargetSetting = new SettingInfo
|
|
585
|
+
{
|
|
586
|
+
name = "Build Target Platform",
|
|
587
|
+
isOptimal = status.buildTarget == BuildTarget.WebGL,
|
|
588
|
+
current = $"• Current: {status.buildTarget}",
|
|
589
|
+
recommended = "• Recommended: WebGL",
|
|
590
|
+
description = "The Unity build target must be set to WebGL for HyperSDK builds. Building for Windows, Android, or any other platform will not work with the HyperGames platform.",
|
|
591
|
+
priority = SettingPriority.Critical,
|
|
592
|
+
type = SettingType.BuildTargetPlatform
|
|
593
|
+
};
|
|
594
|
+
CategorizeSettings(buildTargetSetting, optimalSettings, recommendedSettings, outstandingSettings);
|
|
595
|
+
|
|
584
596
|
// Note: Texture compression is platform-specific (Android/iOS) and not applicable to WebGL builds
|
|
585
597
|
// WebGL handles texture compression at runtime via browser support
|
|
586
598
|
// This setting is kept for reference but won't affect WebGL builds
|
|
@@ -725,6 +737,15 @@ namespace Hyper.Editor
|
|
|
725
737
|
};
|
|
726
738
|
CategorizeSettings(colorSpaceSetting, optimal, recommended, outstanding);
|
|
727
739
|
|
|
740
|
+
var buildTargetSetting = new SettingInfo
|
|
741
|
+
{
|
|
742
|
+
name = "Build Target Platform",
|
|
743
|
+
isOptimal = status.buildTarget == BuildTarget.WebGL,
|
|
744
|
+
priority = SettingPriority.Critical,
|
|
745
|
+
type = SettingType.BuildTargetPlatform
|
|
746
|
+
};
|
|
747
|
+
CategorizeSettings(buildTargetSetting, optimal, recommended, outstanding);
|
|
748
|
+
|
|
728
749
|
// Note: Texture compression is platform-specific and not applicable to WebGL builds
|
|
729
750
|
}
|
|
730
751
|
|
|
@@ -1037,6 +1058,28 @@ namespace Hyper.Editor
|
|
|
1037
1058
|
if (IsSDKDeveloper()) HyperDebug.LogSuccess("Applied: Color Space -> Gamma");
|
|
1038
1059
|
break;
|
|
1039
1060
|
|
|
1061
|
+
case SettingType.BuildTargetPlatform:
|
|
1062
|
+
try
|
|
1063
|
+
{
|
|
1064
|
+
if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.WebGL)
|
|
1065
|
+
{
|
|
1066
|
+
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WebGL, BuildTarget.WebGL);
|
|
1067
|
+
if (IsSDKDeveloper()) HyperDebug.LogSuccess("Applied: Build Target -> WebGL");
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
catch (System.Exception e)
|
|
1071
|
+
{
|
|
1072
|
+
EditorUtility.DisplayDialog(
|
|
1073
|
+
"Build Target Switch Failed",
|
|
1074
|
+
$"Could not switch build target to WebGL:\n\n{e.Message}\n\n" +
|
|
1075
|
+
"Please manually switch to WebGL in:\n" +
|
|
1076
|
+
"File > Build Settings > WebGL > Switch Platform",
|
|
1077
|
+
"OK"
|
|
1078
|
+
);
|
|
1079
|
+
HyperDebug.LogError($"Failed to switch build target: {e.Message}");
|
|
1080
|
+
}
|
|
1081
|
+
break;
|
|
1082
|
+
|
|
1040
1083
|
case SettingType.TextureCompression:
|
|
1041
1084
|
// Texture compression is platform-specific (Android/iOS) and not applicable to WebGL
|
|
1042
1085
|
// WebGL handles texture compression at runtime via browser support
|
|
@@ -2501,7 +2544,8 @@ namespace Hyper.Editor
|
|
|
2501
2544
|
MemoryGrowthMode,
|
|
2502
2545
|
ShowSplashScreen,
|
|
2503
2546
|
ColorSpace,
|
|
2504
|
-
TextureCompression
|
|
2547
|
+
TextureCompression,
|
|
2548
|
+
BuildTargetPlatform
|
|
2505
2549
|
}
|
|
2506
2550
|
|
|
2507
2551
|
private class SettingInfo
|
|
@@ -2536,8 +2580,9 @@ namespace Hyper.Editor
|
|
|
2536
2580
|
public ColorSpace colorSpace;
|
|
2537
2581
|
public TextureImporterFormat textureCompression;
|
|
2538
2582
|
public bool showSplashScreen;
|
|
2583
|
+
public BuildTarget buildTarget;
|
|
2539
2584
|
|
|
2540
|
-
public int GetTotalSettings() =>
|
|
2585
|
+
public int GetTotalSettings() => 17;
|
|
2541
2586
|
|
|
2542
2587
|
public int GetConfiguredSettings()
|
|
2543
2588
|
{
|
|
@@ -2560,6 +2605,7 @@ namespace Hyper.Editor
|
|
|
2560
2605
|
if (IsHyperLoaderTemplate(webGLTemplate)) count++;
|
|
2561
2606
|
if (hyperLoaderAtIndex0) count++;
|
|
2562
2607
|
if (colorSpace == ColorSpace.Gamma) count++;
|
|
2608
|
+
if (buildTarget == BuildTarget.WebGL) count++;
|
|
2563
2609
|
|
|
2564
2610
|
return count;
|
|
2565
2611
|
}
|
|
@@ -2717,6 +2763,9 @@ namespace Hyper.Editor
|
|
|
2717
2763
|
// Setting to Automatic as placeholder (not used for WebGL)
|
|
2718
2764
|
TextureImporterFormat defaultTexFormat = TextureImporterFormat.Automatic;
|
|
2719
2765
|
|
|
2766
|
+
// Get active build target
|
|
2767
|
+
BuildTarget activeBuildTarget = EditorUserBuildSettings.activeBuildTarget;
|
|
2768
|
+
|
|
2720
2769
|
return new WebGLSettingsStatus
|
|
2721
2770
|
{
|
|
2722
2771
|
compressionFormat = PlayerSettings.WebGL.compressionFormat,
|
|
@@ -2737,7 +2786,8 @@ namespace Hyper.Editor
|
|
|
2737
2786
|
memoryGrowthMode = memGrowthMode,
|
|
2738
2787
|
showSplashScreen = PlayerSettings.SplashScreen.show,
|
|
2739
2788
|
colorSpace = currentColorSpace,
|
|
2740
|
-
textureCompression = defaultTexFormat
|
|
2789
|
+
textureCompression = defaultTexFormat,
|
|
2790
|
+
buildTarget = activeBuildTarget
|
|
2741
2791
|
};
|
|
2742
2792
|
}
|
|
2743
2793
|
|
|
@@ -21,14 +21,6 @@ namespace Hyper.Editor
|
|
|
21
21
|
|
|
22
22
|
#endregion
|
|
23
23
|
|
|
24
|
-
#region Window Configuration
|
|
25
|
-
|
|
26
|
-
private const string WINDOW_TITLE = "Core Settings";
|
|
27
|
-
private static readonly Vector2 MIN_WINDOW_SIZE = new Vector2(550, 490);
|
|
28
|
-
private static readonly Vector2 MAX_WINDOW_SIZE = new Vector2(550, 500);
|
|
29
|
-
|
|
30
|
-
#endregion
|
|
31
|
-
|
|
32
24
|
#region Menu Items
|
|
33
25
|
|
|
34
26
|
[MenuItem("Hyper/Settings/Core", false, 400)]
|
|
@@ -19,14 +19,6 @@ namespace Hyper.Editor
|
|
|
19
19
|
|
|
20
20
|
#endregion
|
|
21
21
|
|
|
22
|
-
#region Window Configuration
|
|
23
|
-
|
|
24
|
-
private const string WINDOW_TITLE = "Game Content";
|
|
25
|
-
private static readonly Vector2 MIN_WINDOW_SIZE = new Vector2(550, 320);
|
|
26
|
-
private static readonly Vector2 MAX_WINDOW_SIZE = new Vector2(550, 350);
|
|
27
|
-
|
|
28
|
-
#endregion
|
|
29
|
-
|
|
30
22
|
#region Menu Item
|
|
31
23
|
|
|
32
24
|
[MenuItem("Hyper/Settings/Game Content" , false, 401)]
|
|
@@ -35,8 +35,8 @@ namespace Hyper.Editor
|
|
|
35
35
|
#region Window Configuration
|
|
36
36
|
|
|
37
37
|
private const string WINDOW_TITLE = "HyperSDK Settings";
|
|
38
|
-
private static readonly Vector2 MIN_WINDOW_SIZE = new Vector2(600,
|
|
39
|
-
private static readonly Vector2 MAX_WINDOW_SIZE = new Vector2(
|
|
38
|
+
private static readonly Vector2 MIN_WINDOW_SIZE = new Vector2(600, 660);
|
|
39
|
+
private static readonly Vector2 MAX_WINDOW_SIZE = new Vector2(601, 700);
|
|
40
40
|
|
|
41
41
|
#endregion
|
|
42
42
|
|
|
@@ -205,7 +205,7 @@ namespace Hyper.Editor
|
|
|
205
205
|
EditorGUILayout.Space(4);
|
|
206
206
|
|
|
207
207
|
EditorGUILayout.HelpBox(
|
|
208
|
-
"Configure
|
|
208
|
+
"Configure platforms, orientations, start CTA, control bar layout, and editor simulation settings.",
|
|
209
209
|
MessageType.Info);
|
|
210
210
|
|
|
211
211
|
EditorGUILayout.Space(8);
|