app.hypergames.hypersdk 1.8.18 → 1.8.20
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/HyperLoader.unity +3 -3
- package/Runtime/Internal/Managers/DataManager.cs +38 -2
- package/Runtime/Internal/Managers/GameManager.cs +34 -23
- package/Runtime/Internal/UI/Animation/SlideUp.cs +6 -1
- package/Runtime/Internal/UI/Components/RoundedRawImage.cs +146 -0
- package/Runtime/Internal/UI/Components/RoundedRawImage.cs.meta +11 -0
- package/Runtime/Internal/UI/Modals/GamePausedModal.cs +4 -2
- package/Runtime/Internal/UI/Modals/TutorialButton.cs +10 -0
- package/Runtime/Internal/UI/Modals/TutorialLoaderModal.cs +28 -2
- package/Runtime/Internal/UI/Modals/TutorialModal.cs +721 -47
- package/Runtime/Plugins/WebGL/HyperTutorialCachePlugin.jslib +35 -53
- package/Runtime/Resources/Materials/RoundedRawImage.mat +65 -0
- package/Runtime/Resources/Materials/RoundedRawImage.mat.meta +8 -0
- package/Runtime/Resources/Materials.meta +8 -0
- package/Runtime/Resources/RenderTextures/TutorialVideoTexture P.renderTexture +3 -3
- package/Runtime/Resources/Shaders/RoundedRawImage.shader +142 -0
- package/Runtime/Resources/Shaders/RoundedRawImage.shader.meta +10 -0
- package/Runtime/Resources/Shaders/RoundedStrip.shader +152 -0
- package/Runtime/Resources/Shaders/RoundedStrip.shader.meta +10 -0
- package/Runtime/Resources/Shaders.meta +8 -0
- package/Runtime/Resources/Sprites/Frames/Square.png +0 -0
- package/Runtime/Resources/Sprites/Frames/Square.png.meta +186 -0
- package/Runtime/Resources/Sprites/TutorialModal/Button_Back.png.meta +1 -1
- package/Runtime/Resources/Sprites/TutorialModal/Button_Next.png.meta +1 -1
- package/Runtime/Resources/Sprites/TutorialModal/Knob.png.meta +1 -1
- package/Runtime/Resources/Sprites/TutorialModal/Tutorial_Background_Portrait.png.meta +3 -3
- package/Runtime/Resources/UIPrefabs/Content.prefab +1672 -0
- package/Runtime/Resources/UIPrefabs/Content.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/GamePausedModal_Battle.prefab +16 -0
- package/Runtime/Resources/UIPrefabs/GamePausedModal_Battle_Landscape.prefab +17 -1
- package/Runtime/Resources/UIPrefabs/GamePausedModal_Practice.prefab +11 -178
- package/Runtime/Resources/UIPrefabs/GamePausedModal_Practice_Landscape.prefab +16 -0
- package/Runtime/Resources/UIPrefabs/IndicatorCircle.prefab +2 -2
- package/Runtime/Resources/UIPrefabs/TutorialLandscapeModal.prefab +121 -51
- package/Runtime/Resources/UIPrefabs/TutorialPortraitModal.prefab +497 -1469
- package/Runtime/Shared/DTOs/TutorialData.cs +18 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.8.20](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.19...v1.8.20) (2026-07-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **tutorial:** enhance display with rounded corners ([f240203](https://github.com/mvmhyper/hyper-sdk/commit/f240203d4ad14df7c6c481df1d656ea4bc356ad7))
|
|
7
|
+
* update tutorial modal content flow ([a6fb29b](https://github.com/mvmhyper/hyper-sdk/commit/a6fb29b092cd7902493031c87868df58a9775500))
|
|
8
|
+
|
|
9
|
+
## [1.8.19](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.18...v1.8.19) (2026-06-23)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* align footer button spacing in SDK pause modal across orientations ([f917e8c](https://github.com/mvmhyper/hyper-sdk/commit/f917e8cce6cd7234fc73bf401629df19cae2ed54))
|
|
15
|
+
|
|
1
16
|
## [1.8.18](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.17...v1.8.18) (2026-06-22)
|
|
2
17
|
|
|
3
18
|
|
package/HyperLoader.unity
CHANGED
|
@@ -304,7 +304,7 @@ RectTransform:
|
|
|
304
304
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
305
305
|
m_AnchorMin: {x: 0, y: 1}
|
|
306
306
|
m_AnchorMax: {x: 0, y: 1}
|
|
307
|
-
m_AnchoredPosition: {x:
|
|
307
|
+
m_AnchoredPosition: {x: 489.112, y: -280.1698}
|
|
308
308
|
m_SizeDelta: {x: 1044.9, y: 239.347}
|
|
309
309
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
310
310
|
--- !u!114 &751153944
|
|
@@ -840,7 +840,7 @@ GameObject:
|
|
|
840
840
|
m_Component:
|
|
841
841
|
- component: {fileID: 1064166296}
|
|
842
842
|
m_Layer: 0
|
|
843
|
-
m_Name:
|
|
843
|
+
m_Name: __HyperSDK_BuildMarker_639190246458492972
|
|
844
844
|
m_TagString: Untagged
|
|
845
845
|
m_Icon: {fileID: 0}
|
|
846
846
|
m_NavMeshLayer: 0
|
|
@@ -1092,7 +1092,7 @@ RectTransform:
|
|
|
1092
1092
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
1093
1093
|
m_AnchorMin: {x: 0, y: 1}
|
|
1094
1094
|
m_AnchorMax: {x: 0, y: 1}
|
|
1095
|
-
m_AnchoredPosition: {x:
|
|
1095
|
+
m_AnchoredPosition: {x: 489.112, y: -133.2274}
|
|
1096
1096
|
m_SizeDelta: {x: 875, y: 54.5378}
|
|
1097
1097
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
1098
1098
|
--- !u!1 &2874543288936963705
|
|
@@ -403,7 +403,33 @@ namespace Hyper.Internal.Managers
|
|
|
403
403
|
try
|
|
404
404
|
{
|
|
405
405
|
var data = JsonUtility.FromJson<TutorialResourceData>(jsonData);
|
|
406
|
-
if (data.
|
|
406
|
+
if (data.cards != null && data.cards.Length > 0)
|
|
407
|
+
{
|
|
408
|
+
TutorialCardData[] cards = new TutorialCardData[data.cards.Length];
|
|
409
|
+
|
|
410
|
+
for (int i = 0; i < data.cards.Length; i++)
|
|
411
|
+
{
|
|
412
|
+
TutorialCardResourceData sourceCard = data.cards[i];
|
|
413
|
+
string type = (sourceCard.type ?? string.Empty).ToLowerInvariant();
|
|
414
|
+
bool isVideo = type == "video";
|
|
415
|
+
|
|
416
|
+
cards[i] = new TutorialCardData
|
|
417
|
+
{
|
|
418
|
+
type = isVideo ? TutorialType.video : TutorialType.images,
|
|
419
|
+
position = sourceCard.position,
|
|
420
|
+
description = sourceCard.description,
|
|
421
|
+
videoUrl = isVideo ? sourceCard.url : null,
|
|
422
|
+
imageUrl = isVideo ? null : sourceCard.url
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
TutorialData = new TutorialData
|
|
427
|
+
{
|
|
428
|
+
type = cards[0].type,
|
|
429
|
+
cards = cards
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
else if (data.type == "video")
|
|
407
433
|
{
|
|
408
434
|
TutorialData = new TutorialData
|
|
409
435
|
{
|
|
@@ -440,6 +466,16 @@ namespace Hyper.Internal.Managers
|
|
|
440
466
|
public string type;
|
|
441
467
|
public string url;
|
|
442
468
|
public string[] urls;
|
|
469
|
+
public TutorialCardResourceData[] cards;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
[Serializable]
|
|
473
|
+
private class TutorialCardResourceData
|
|
474
|
+
{
|
|
475
|
+
public string type;
|
|
476
|
+
public string url;
|
|
477
|
+
public string description;
|
|
478
|
+
public int position;
|
|
443
479
|
}
|
|
444
480
|
|
|
445
481
|
#endregion
|
|
@@ -457,4 +493,4 @@ namespace Hyper
|
|
|
457
493
|
}
|
|
458
494
|
|
|
459
495
|
#endregion
|
|
460
|
-
}
|
|
496
|
+
}
|
|
@@ -6,10 +6,10 @@ using UnityEngine;
|
|
|
6
6
|
using UnityEngine.EventSystems;
|
|
7
7
|
using UnityEngine.SceneManagement;
|
|
8
8
|
using UnityEngine.UI;
|
|
9
|
-
using System.Linq;
|
|
10
9
|
using Newtonsoft.Json;
|
|
11
10
|
using Hyper.Internal;
|
|
12
11
|
using Hyper.Shared;
|
|
12
|
+
using System.Linq;
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
namespace Hyper.Internal.Managers
|
|
@@ -505,11 +505,13 @@ namespace Hyper.Internal.Managers
|
|
|
505
505
|
{
|
|
506
506
|
bool isPortrait = ResolvePortraitFlag();
|
|
507
507
|
var activeModal = EnsureTutorialModal(isPortrait);
|
|
508
|
+
_tutorialModalComponent = activeModal.GetComponent<TutorialModal>();
|
|
509
|
+
MoveTutorialModalToCanvasTop(activeModal);
|
|
508
510
|
|
|
509
511
|
if (showModal)
|
|
510
512
|
{
|
|
513
|
+
MoveTutorialModalToCanvasTop(activeModal);
|
|
511
514
|
_tutorialModalComponent.Show();
|
|
512
|
-
activeModal.transform.SetAsLastSibling();
|
|
513
515
|
}
|
|
514
516
|
}
|
|
515
517
|
|
|
@@ -1001,8 +1003,8 @@ namespace Hyper.Internal.Managers
|
|
|
1001
1003
|
|
|
1002
1004
|
_canvasScaler = _canvas.GetComponent<CanvasScaler>();
|
|
1003
1005
|
_canvasScaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
|
|
1004
|
-
_canvasScaler.referenceResolution = new Vector2(1080,
|
|
1005
|
-
_canvasScaler.matchWidthOrHeight = IsPortrait() ?
|
|
1006
|
+
_canvasScaler.referenceResolution = new Vector2(1080, 2160);
|
|
1007
|
+
_canvasScaler.matchWidthOrHeight = IsPortrait() ? 1f : 0.593f;
|
|
1006
1008
|
|
|
1007
1009
|
CreateHyperCanvasSafeArea();
|
|
1008
1010
|
CreateHyperCanvasBlockerUI();
|
|
@@ -1552,6 +1554,7 @@ namespace Hyper.Internal.Managers
|
|
|
1552
1554
|
_tutorialLandscapeModal.SetActive(false);
|
|
1553
1555
|
}
|
|
1554
1556
|
|
|
1557
|
+
MoveTutorialModalToCanvasTop(_tutorialPortraitModal);
|
|
1555
1558
|
return _tutorialPortraitModal;
|
|
1556
1559
|
}
|
|
1557
1560
|
else
|
|
@@ -1570,6 +1573,7 @@ namespace Hyper.Internal.Managers
|
|
|
1570
1573
|
_tutorialPortraitModal.SetActive(false);
|
|
1571
1574
|
}
|
|
1572
1575
|
|
|
1576
|
+
MoveTutorialModalToCanvasTop(_tutorialLandscapeModal);
|
|
1573
1577
|
return _tutorialLandscapeModal;
|
|
1574
1578
|
}
|
|
1575
1579
|
}
|
|
@@ -1584,32 +1588,22 @@ namespace Hyper.Internal.Managers
|
|
|
1584
1588
|
|
|
1585
1589
|
GameObject prefab = Resources.Load<GameObject>(prefabPath);
|
|
1586
1590
|
GameObject instance = Instantiate(prefab);
|
|
1587
|
-
instance.transform.SetParent(
|
|
1591
|
+
instance.transform.SetParent(_canvas.transform, false);
|
|
1588
1592
|
|
|
1589
1593
|
RectTransform rectTransform = instance.GetComponent<RectTransform>();
|
|
1590
1594
|
if (rectTransform != null)
|
|
1591
1595
|
{
|
|
1592
1596
|
rectTransform.anchorMin = Vector2.zero;
|
|
1593
1597
|
rectTransform.anchorMax = Vector2.one;
|
|
1594
|
-
rectTransform.
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
if (safeArea != null)
|
|
1600
|
-
{
|
|
1601
|
-
RectTransform safeAreaRect = safeArea.GetComponent<RectTransform>();
|
|
1602
|
-
if (safeAreaRect != null)
|
|
1603
|
-
{
|
|
1604
|
-
rectTransform.anchoredPosition = new Vector2(
|
|
1605
|
-
rectTransform.anchoredPosition.x,
|
|
1606
|
-
-safeAreaRect.rect.height
|
|
1607
|
-
);
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1598
|
+
rectTransform.offsetMin = Vector2.zero;
|
|
1599
|
+
rectTransform.offsetMax = Vector2.zero;
|
|
1600
|
+
rectTransform.pivot = new Vector2(0.5f, 0.5f);
|
|
1601
|
+
rectTransform.anchoredPosition = Vector2.zero;
|
|
1602
|
+
rectTransform.sizeDelta = Vector2.zero;
|
|
1611
1603
|
}
|
|
1612
1604
|
|
|
1605
|
+
MoveTutorialModalToCanvasTop(instance);
|
|
1606
|
+
|
|
1613
1607
|
if (portrait)
|
|
1614
1608
|
{
|
|
1615
1609
|
_tutorialPortraitModal = instance;
|
|
@@ -1622,6 +1616,23 @@ namespace Hyper.Internal.Managers
|
|
|
1622
1616
|
_tutorialModalComponent = instance.GetComponent<TutorialModal>();
|
|
1623
1617
|
}
|
|
1624
1618
|
|
|
1619
|
+
private void MoveTutorialModalToCanvasTop(GameObject tutorialModal)
|
|
1620
|
+
{
|
|
1621
|
+
if (tutorialModal == null) return;
|
|
1622
|
+
if (_canvas == null) CreateCanvas();
|
|
1623
|
+
|
|
1624
|
+
RectTransform rectTransform = tutorialModal.GetComponent<RectTransform>();
|
|
1625
|
+
tutorialModal.transform.SetParent(_canvas.transform, false);
|
|
1626
|
+
tutorialModal.transform.SetAsLastSibling();
|
|
1627
|
+
|
|
1628
|
+
if (rectTransform == null) return;
|
|
1629
|
+
|
|
1630
|
+
rectTransform.anchorMin = Vector2.zero;
|
|
1631
|
+
rectTransform.anchorMax = Vector2.one;
|
|
1632
|
+
rectTransform.offsetMin = Vector2.zero;
|
|
1633
|
+
rectTransform.offsetMax = Vector2.zero;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1625
1636
|
private void HideTutorialModals()
|
|
1626
1637
|
{
|
|
1627
1638
|
if (_tutorialPortraitModal != null) _tutorialPortraitModal.SetActive(false);
|
|
@@ -1663,4 +1674,4 @@ namespace Hyper.Internal.Managers
|
|
|
1663
1674
|
|
|
1664
1675
|
#endregion
|
|
1665
1676
|
}
|
|
1666
|
-
}
|
|
1677
|
+
}
|
|
@@ -62,6 +62,11 @@ namespace Hyper.Internal
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
public void SlideUpAnimation()
|
|
65
|
+
{
|
|
66
|
+
SlideUpAnimation(0.5f);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public void SlideUpAnimation(float duration)
|
|
65
70
|
{
|
|
66
71
|
if (!isInitialized || rectTransform == null)
|
|
67
72
|
{
|
|
@@ -82,7 +87,7 @@ namespace Hyper.Internal
|
|
|
82
87
|
rectTransform.anchoredPosition = new Vector2(originalAnchoredPosition.x, offScreenY);
|
|
83
88
|
|
|
84
89
|
// Animate to original position
|
|
85
|
-
rectTransform.DOAnchorPosY(originalAnchoredPosition.y,
|
|
90
|
+
rectTransform.DOAnchorPosY(originalAnchoredPosition.y, duration)
|
|
86
91
|
.SetEase(HyperTween.Ease.OutQuad)
|
|
87
92
|
.SetUpdate(true);
|
|
88
93
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using UnityEngine.UI;
|
|
3
|
+
|
|
4
|
+
namespace Hyper.Internal
|
|
5
|
+
{
|
|
6
|
+
[RequireComponent(typeof(RawImage))]
|
|
7
|
+
public class RoundedRawImage : MonoBehaviour
|
|
8
|
+
{
|
|
9
|
+
private const string ShaderResourcePath = "Shaders/RoundedRawImage";
|
|
10
|
+
private const string MaterialResourcePath = "Materials/RoundedRawImage";
|
|
11
|
+
private static readonly int RadiusId = Shader.PropertyToID("_Radius");
|
|
12
|
+
private static readonly int CornerRadiiId = Shader.PropertyToID("_CornerRadii");
|
|
13
|
+
private static readonly int SoftnessId = Shader.PropertyToID("_Softness");
|
|
14
|
+
private static readonly int RectSizeId = Shader.PropertyToID("_RectSize");
|
|
15
|
+
private static readonly int PivotId = Shader.PropertyToID("_Pivot");
|
|
16
|
+
private static readonly int UseUIAlphaClipId = Shader.PropertyToID("_UseUIAlphaClip");
|
|
17
|
+
|
|
18
|
+
[SerializeField] private float radius = 28f;
|
|
19
|
+
[SerializeField] private float softness = 1.5f;
|
|
20
|
+
[SerializeField] private Vector4 cornerRadii = new Vector4(28f, 28f, 28f, 28f);
|
|
21
|
+
[SerializeField] private Vector2 materialPivotReference = new Vector2(0.5f, 0.4535f);
|
|
22
|
+
|
|
23
|
+
private RawImage rawImage;
|
|
24
|
+
private RectTransform rectTransform;
|
|
25
|
+
private RectTransform parentRectTransform;
|
|
26
|
+
private Material materialInstance;
|
|
27
|
+
|
|
28
|
+
internal void Configure(float cornerRadius, float edgeSoftness)
|
|
29
|
+
{
|
|
30
|
+
Configure(new Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius), edgeSoftness);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
internal void Configure(Vector4 radii, float edgeSoftness)
|
|
34
|
+
{
|
|
35
|
+
cornerRadii = new Vector4(
|
|
36
|
+
Mathf.Max(0f, radii.x),
|
|
37
|
+
Mathf.Max(0f, radii.y),
|
|
38
|
+
Mathf.Max(0f, radii.z),
|
|
39
|
+
Mathf.Max(0f, radii.w)
|
|
40
|
+
);
|
|
41
|
+
radius = Mathf.Max(cornerRadii.x, cornerRadii.y, cornerRadii.z, cornerRadii.w);
|
|
42
|
+
softness = Mathf.Max(0.001f, edgeSoftness);
|
|
43
|
+
EnsureMaterial();
|
|
44
|
+
ApplyProperties(true);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private void Awake()
|
|
48
|
+
{
|
|
49
|
+
EnsureMaterial();
|
|
50
|
+
ApplyProperties(true);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private void OnEnable()
|
|
54
|
+
{
|
|
55
|
+
EnsureMaterial();
|
|
56
|
+
ApplyProperties(true);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private void LateUpdate()
|
|
60
|
+
{
|
|
61
|
+
ApplyProperties(false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private void OnValidate()
|
|
65
|
+
{
|
|
66
|
+
if (!Application.isPlaying || !isActiveAndEnabled) return;
|
|
67
|
+
|
|
68
|
+
EnsureMaterial();
|
|
69
|
+
ApplyProperties(true);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private void OnDestroy()
|
|
73
|
+
{
|
|
74
|
+
if (materialInstance != null)
|
|
75
|
+
{
|
|
76
|
+
Destroy(materialInstance);
|
|
77
|
+
materialInstance = null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private void EnsureMaterial()
|
|
82
|
+
{
|
|
83
|
+
if (rawImage == null) rawImage = GetComponent<RawImage>();
|
|
84
|
+
if (rectTransform == null) rectTransform = transform as RectTransform;
|
|
85
|
+
if (parentRectTransform == null && transform.parent != null)
|
|
86
|
+
{
|
|
87
|
+
parentRectTransform = transform.parent as RectTransform;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (materialInstance != null)
|
|
91
|
+
{
|
|
92
|
+
rawImage.material = materialInstance;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Material sourceMaterial = Resources.Load<Material>(MaterialResourcePath);
|
|
97
|
+
if (sourceMaterial != null)
|
|
98
|
+
{
|
|
99
|
+
materialInstance = new Material(sourceMaterial)
|
|
100
|
+
{
|
|
101
|
+
name = "Tutorial Rounded Raw Image (Instance)"
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
rawImage.material = materialInstance;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
Shader shader = Resources.Load<Shader>(ShaderResourcePath);
|
|
109
|
+
if (shader == null)
|
|
110
|
+
{
|
|
111
|
+
shader = Shader.Find("Hyper/UI/Rounded Raw Image");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (shader == null)
|
|
115
|
+
{
|
|
116
|
+
Debug.LogWarning("RoundedRawImage could not find the Hyper/UI/Rounded Raw Image shader.");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
materialInstance = new Material(shader)
|
|
121
|
+
{
|
|
122
|
+
name = "Tutorial Rounded Raw Image (Instance)"
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
rawImage.material = materialInstance;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private void ApplyProperties(bool force)
|
|
129
|
+
{
|
|
130
|
+
if (materialInstance == null || rectTransform == null) return;
|
|
131
|
+
|
|
132
|
+
RectTransform sizeSource = parentRectTransform != null && parentRectTransform.name.Contains("Display Area") ?
|
|
133
|
+
parentRectTransform : rectTransform;
|
|
134
|
+
Vector2 size = sizeSource.rect.size;
|
|
135
|
+
Vector2 pivot = materialPivotReference;
|
|
136
|
+
|
|
137
|
+
materialInstance.SetFloat(RadiusId, radius);
|
|
138
|
+
materialInstance.SetVector(CornerRadiiId, cornerRadii);
|
|
139
|
+
materialInstance.SetFloat(SoftnessId, softness);
|
|
140
|
+
materialInstance.SetVector(RectSizeId, new Vector4(size.x, size.y, 0f, 0f));
|
|
141
|
+
materialInstance.SetVector(PivotId, new Vector4(pivot.x, pivot.y, 0f, 0f));
|
|
142
|
+
materialInstance.SetFloat(UseUIAlphaClipId, 1f);
|
|
143
|
+
materialInstance.EnableKeyword("UNITY_UI_ALPHACLIP");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -51,12 +51,14 @@ namespace Hyper.Internal
|
|
|
51
51
|
if (restartButton != null) restartButton.SetActive(!HyperRuntime.GameContent.IsPracticeMenu);
|
|
52
52
|
|
|
53
53
|
if (_gameManager.IsPracticeMode && footerHLG != null)
|
|
54
|
-
footerHLG.spacing = HyperRuntime.GameContent.IsPracticeMenu ?
|
|
54
|
+
footerHLG.spacing = HyperRuntime.GameContent.IsPracticeMenu ? 246 : 42;
|
|
55
55
|
|
|
56
|
+
#if !UNITY_EDITOR
|
|
56
57
|
if (HyperRuntime.BackendManager.tutorialDoesNotExist)
|
|
57
58
|
{
|
|
58
59
|
UpdateTutorialButtonSpacing();
|
|
59
60
|
}
|
|
61
|
+
#endif
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
void OnDestroy()
|
|
@@ -71,7 +73,7 @@ namespace Hyper.Internal
|
|
|
71
73
|
{
|
|
72
74
|
if (_gameManager.IsPracticeMode)
|
|
73
75
|
{
|
|
74
|
-
footerHLG.spacing = HyperRuntime.GameContent.IsPracticeMenu ?
|
|
76
|
+
footerHLG.spacing = HyperRuntime.GameContent.IsPracticeMenu ? 190 : 10;
|
|
75
77
|
}
|
|
76
78
|
else
|
|
77
79
|
{
|
|
@@ -28,6 +28,11 @@ namespace Hyper.Internal
|
|
|
28
28
|
// Start is called before the first frame update
|
|
29
29
|
void OnEnable()
|
|
30
30
|
{
|
|
31
|
+
#if UNITY_EDITOR
|
|
32
|
+
EnableTutorialButton();
|
|
33
|
+
return;
|
|
34
|
+
#endif
|
|
35
|
+
|
|
31
36
|
if (HyperRuntime.BackendManager.tutorialDoesNotExist)
|
|
32
37
|
{
|
|
33
38
|
DisableTutorialButton();
|
|
@@ -50,6 +55,11 @@ namespace Hyper.Internal
|
|
|
50
55
|
|
|
51
56
|
void DisableTutorialButton()
|
|
52
57
|
{
|
|
58
|
+
#if UNITY_EDITOR
|
|
59
|
+
EnableTutorialButton();
|
|
60
|
+
return;
|
|
61
|
+
#endif
|
|
62
|
+
|
|
53
63
|
tutorialEnabled.gameObject.SetActive(false);
|
|
54
64
|
tutorialDisabled.gameObject.SetActive(true);
|
|
55
65
|
|
|
@@ -33,6 +33,9 @@ namespace Hyper.Internal
|
|
|
33
33
|
|
|
34
34
|
void OnEnable()
|
|
35
35
|
{
|
|
36
|
+
KillTweens();
|
|
37
|
+
tutorialLoaderModalCG.alpha = 0f;
|
|
38
|
+
|
|
36
39
|
// Fade in and enable
|
|
37
40
|
tutorialLoaderModalCG.DOFade(1, 0.3f).SetUpdate(true);
|
|
38
41
|
|
|
@@ -56,9 +59,12 @@ namespace Hyper.Internal
|
|
|
56
59
|
|
|
57
60
|
void HandleTutorialLoadingComplete()
|
|
58
61
|
{
|
|
62
|
+
if (!gameObject.activeInHierarchy) return;
|
|
63
|
+
|
|
59
64
|
// Debug.Log($"Tutorial Loading Completed!");
|
|
60
65
|
|
|
61
66
|
// Fade out and disable
|
|
67
|
+
tutorialLoaderModalCG.DOKill();
|
|
62
68
|
tutorialLoaderModalCG.DOFade(0, 0.15f).SetDelay(2f).SetUpdate(true).OnComplete(() =>
|
|
63
69
|
{
|
|
64
70
|
tutorialLoaderModalCG.gameObject.SetActive(false);
|
|
@@ -68,10 +74,19 @@ namespace Hyper.Internal
|
|
|
68
74
|
void HandleLoadingTutorial()
|
|
69
75
|
{
|
|
70
76
|
KillTweens();
|
|
77
|
+
bool shouldFailEditorRetry = false;
|
|
71
78
|
|
|
72
79
|
if (loadingFailedOnce)
|
|
73
80
|
{
|
|
81
|
+
#if UNITY_EDITOR
|
|
82
|
+
TutorialModal tutorialModal = GetComponentInParent<TutorialModal>(true);
|
|
83
|
+
if (tutorialModal == null || !tutorialModal.TryStartEditorTutorialLoad())
|
|
84
|
+
{
|
|
85
|
+
shouldFailEditorRetry = true;
|
|
86
|
+
}
|
|
87
|
+
#else
|
|
74
88
|
HyperRuntime.BackendManager.GetTutorial(() => { });
|
|
89
|
+
#endif
|
|
75
90
|
|
|
76
91
|
// Move UI from failed position back to start position
|
|
77
92
|
rectTransform.DOAnchorPos(loaderStartPosition, 0.5f).SetUpdate(true).SetEase(HyperTween.Ease.OutQuad);
|
|
@@ -93,6 +108,17 @@ namespace Hyper.Internal
|
|
|
93
108
|
|
|
94
109
|
loaderText.SetActive(false);
|
|
95
110
|
loaderTextTween.SetActive(true);
|
|
111
|
+
|
|
112
|
+
if (shouldFailEditorRetry)
|
|
113
|
+
{
|
|
114
|
+
StartCoroutine(InvokeTutorialFetchFailedNextFrame());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private System.Collections.IEnumerator InvokeTutorialFetchFailedNextFrame()
|
|
119
|
+
{
|
|
120
|
+
yield return null;
|
|
121
|
+
_eventManager.InvokeTutorialFetchFailedEvent();
|
|
96
122
|
}
|
|
97
123
|
|
|
98
124
|
void HandleTutorialFailed()
|
|
@@ -119,8 +145,8 @@ namespace Hyper.Internal
|
|
|
119
145
|
{
|
|
120
146
|
rectTransform.DOKill();
|
|
121
147
|
loadingFailedElements.DOKill();
|
|
148
|
+
tutorialLoaderModalCG.DOKill();
|
|
122
149
|
}
|
|
123
150
|
|
|
124
|
-
|
|
125
151
|
}
|
|
126
|
-
}
|
|
152
|
+
}
|