net.dreditor.minigames.ca 0.1.6 → 0.1.8
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/.attestation.p7m +0 -0
- package/ArgumentBuilder.cs +80 -80
- package/ArgumentBuilder.cs.meta +11 -11
- package/ArgumentPage.cs +36 -36
- package/ArgumentPage.cs.meta +11 -11
- package/ArgumentQuestionPanel.cs +136 -136
- package/ArgumentQuestionPanel.cs.meta +11 -11
- package/ClosingArgumentSettings.cs +23 -23
- package/ClosingArgumentSettings.cs.meta +11 -11
- package/ClosingArgumentStockBase.cs +250 -250
- package/ClosingArgumentStockBase.cs.meta +11 -11
- package/DREditor.Minigames.CA.asmdef +24 -24
- package/DREditor.Minigames.CA.asmdef.meta +7 -7
- package/Editor/ArgumentBuilderEditor.cs +139 -139
- package/Editor/ArgumentBuilderEditor.cs.meta +12 -12
- package/Editor/ArgumentPageEditor.cs +283 -283
- package/Editor/ArgumentPageEditor.cs.meta +11 -11
- package/Editor/ArgumentPanelEditor.cs +141 -141
- package/Editor/ArgumentPanelEditor.cs.meta +11 -11
- package/Editor/ArgumentStockEditor.cs +167 -167
- package/Editor/ArgumentStockEditor.cs.meta +11 -11
- package/Editor/CAHandyFields.cs +32 -32
- package/Editor/CAHandyFields.cs.meta +1 -1
- package/Editor/DREditor.Minigames.CA.Editor.asmdef +20 -20
- package/Editor/DREditor.Minigames.CA.Editor.asmdef.meta +7 -7
- package/Editor/PreviewableArgumentBuilderEditor.cs +286 -286
- package/Editor/PreviewableArgumentBuilderEditor.cs.meta +12 -12
- package/Editor.meta +8 -8
- package/IActiveStockPanel.cs +36 -36
- package/IActiveStockPanel.cs.meta +11 -11
- package/IArgumentPreviewInitializer.cs +19 -19
- package/IArgumentPreviewInitializer.cs.meta +11 -11
- package/IClosingArgumentListener.cs +17 -17
- package/IClosingArgumentListener.cs.meta +11 -11
- package/IClosingArgumentPagePreviewer.cs +16 -16
- package/IClosingArgumentPagePreviewer.cs.meta +11 -11
- package/IClosingArgumentResetable.cs +15 -15
- package/IClosingArgumentResetable.cs.meta +11 -11
- package/ILockPreview.cs +16 -16
- package/ILockPreview.cs.meta +11 -11
- package/IPageListener.cs +17 -17
- package/IPageListener.cs.meta +11 -11
- package/IPagesInitializer.cs +17 -17
- package/IPagesInitializer.cs.meta +11 -11
- package/ITotalStockListener.cs +16 -16
- package/ITotalStockListener.cs.meta +11 -11
- package/Managers/ArgumentInitializerBase.cs +17 -17
- package/Managers/ArgumentInitializerBase.cs.meta +11 -11
- package/Managers/ClosingArgumentInitializer.cs +128 -128
- package/Managers/ClosingArgumentInitializer.cs.meta +10 -10
- package/Managers/ClosingArgumentManager.cs +269 -269
- package/Managers/ClosingArgumentManager.cs.meta +10 -10
- package/Managers/ClosingArgumentManagerBase.cs +146 -146
- package/Managers/ClosingArgumentManagerBase.cs.meta +11 -11
- package/Managers/ClosingArgumentPreviewInitializer.cs +80 -80
- package/Managers/ClosingArgumentPreviewInitializer.cs.meta +17 -17
- package/Managers.meta +8 -8
- package/Pages/IPageInitializer.cs +23 -23
- package/Pages/IPageInitializer.cs.meta +11 -11
- package/Pages/MainPagePreviewer.cs +66 -66
- package/Pages/MainPagePreviewer.cs.meta +11 -11
- package/Pages/MiniPageInitializer.cs +144 -144
- package/Pages/MiniPageInitializer.cs.meta +11 -11
- package/Pages/MoveMainPagesComponent.cs +163 -163
- package/Pages/MoveMainPagesComponent.cs.meta +11 -11
- package/Pages/MovePageComponent.cs +104 -104
- package/Pages/MovePageComponent.cs.meta +11 -11
- package/Pages/MovePageHandler.cs +215 -215
- package/Pages/MovePageHandler.cs.meta +11 -11
- package/Pages/PageArrows.cs +124 -124
- package/Pages/PageArrows.cs.meta +11 -11
- package/Pages/PageCounter.cs +65 -65
- package/Pages/PageCounter.cs.meta +11 -11
- package/Pages/PageHandlerBase.cs +30 -30
- package/Pages/PageHandlerBase.cs.meta +11 -11
- package/Pages/PageInitializer.cs +195 -195
- package/Pages/PageInitializer.cs.meta +11 -11
- package/Pages/PageInitializerBase.cs +65 -65
- package/Pages/PageInitializerBase.cs.meta +11 -11
- package/Pages/PagePreviewer.cs +57 -57
- package/Pages/PagePreviewer.cs.meta +11 -11
- package/Pages.meta +8 -8
- package/PanelInitializerBase.cs +147 -147
- package/PanelInitializerBase.cs.meta +11 -11
- package/Panels/ClosingArgumentReticle.cs +169 -169
- package/Panels/ClosingArgumentReticle.cs.meta +11 -11
- package/Panels/ClosingArgumentShooter.cs +153 -153
- package/Panels/ClosingArgumentShooter.cs.meta +11 -11
- package/Panels/CorrectMiniPanelUpdater.cs +45 -45
- package/Panels/CorrectMiniPanelUpdater.cs.meta +11 -11
- package/Panels/CorrectPanelUpdater.cs +24 -24
- package/Panels/CorrectPanelUpdater.cs.meta +11 -11
- package/Panels/PanelInitializer.cs +51 -51
- package/Panels/PanelInitializer.cs.meta +11 -11
- package/Panels/PreviewPanelInitializer.cs +58 -58
- package/Panels/PreviewPanelInitializer.cs.meta +11 -11
- package/Panels/QuestionPanel.cs +143 -143
- package/Panels/QuestionPanel.cs.meta +11 -11
- package/Panels/QuestionPanelBase.cs +68 -68
- package/Panels/QuestionPanelBase.cs.meta +11 -11
- package/Panels.meta +8 -8
- package/{Samples → Samples~}/CACameraEnabled.asset +21 -21
- package/{Samples → Samples~}/CACameraEnabled.asset.meta +8 -8
- package/{Samples → Samples~}/CAPanelTarget.asset +25 -25
- package/{Samples → Samples~}/CAPanelTarget.asset.meta +8 -8
- package/{Samples → Samples~}/CAResult.asset +21 -21
- package/{Samples → Samples~}/CAResult.asset.meta +8 -8
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Hidden Top.anim +600 -600
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Hidden Top.anim.meta +8 -8
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Hidden.anim +600 -600
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Hidden.anim.meta +8 -8
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Shown Top.anim +600 -600
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Shown Top.anim.meta +8 -8
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Shown.anim +582 -582
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Being Shown.anim.meta +8 -8
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Mystery Square.controller +188 -188
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square/Mystery Square.controller.meta +8 -8
- package/{Samples → Samples~}/CA_Animations/CA_Page_Square.meta +8 -8
- package/{Samples → Samples~}/CA_Animations.meta +8 -8
- package/{Samples → Samples~}/Managers/CA_Camera.prefab +159 -159
- package/{Samples → Samples~}/Managers/CA_Camera.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers/CA_Camera_Canvas.prefab +195 -195
- package/{Samples → Samples~}/Managers/CA_Camera_Canvas.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers/CA_Manager_Preview_Shell.prefab +267 -267
- package/{Samples → Samples~}/Managers/CA_Manager_Preview_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers/CA_Manager_Preview_Template.prefab +613 -613
- package/{Samples → Samples~}/Managers/CA_Manager_Preview_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers/CA_Manager_Shell.prefab +443 -443
- package/{Samples → Samples~}/Managers/CA_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers/CA_Manager_Template.prefab +709 -709
- package/{Samples → Samples~}/Managers/CA_Manager_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers/CA_Result_UI_ETemplate.prefab +433 -433
- package/{Samples → Samples~}/Managers/CA_Result_UI_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Managers.meta +8 -8
- package/{Samples → Samples~}/Pages/CA_Colliders.prefab +305 -305
- package/{Samples → Samples~}/Pages/CA_Colliders.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/CA_Main_Page_Arrows_ETemplate.prefab +221 -221
- package/{Samples → Samples~}/Pages/CA_Main_Page_Arrows_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/CA_Page_Gameplay_Shell.prefab +435 -435
- package/{Samples → Samples~}/Pages/CA_Page_Gameplay_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/CA_Page_Gameplay_Template.prefab +220 -220
- package/{Samples → Samples~}/Pages/CA_Page_Gameplay_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/CA_Reticle_ETemplate.prefab +337 -337
- package/{Samples → Samples~}/Pages/CA_Reticle_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/CA_Reticle_Shooter_Template.prefab +148 -148
- package/{Samples → Samples~}/Pages/CA_Reticle_Shooter_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/Mystery_Square_ETemplate.prefab +857 -857
- package/{Samples → Samples~}/Pages/Mystery_Square_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/Page_Add_Ons_ETemplate.prefab +203 -203
- package/{Samples → Samples~}/Pages/Page_Add_Ons_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages/Page_ETemplate.prefab +256 -256
- package/{Samples → Samples~}/Pages/Page_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Pages.meta +8 -8
- package/{Samples → Samples~}/Stocks/CA_Stock_Display_Shell.prefab +110 -110
- package/{Samples → Samples~}/Stocks/CA_Stock_Display_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Stocks/CA_Stock_Display_Template.prefab +731 -731
- package/{Samples → Samples~}/Stocks/CA_Stock_Display_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Stocks/CA_Stock_ETemplate.prefab +427 -427
- package/{Samples → Samples~}/Stocks/CA_Stock_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Stocks/CA_Stock_Parent_Shell.prefab +61 -61
- package/{Samples → Samples~}/Stocks/CA_Stock_Parent_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Stocks/CA_Stock_Parent_Template.prefab +1017 -1017
- package/{Samples → Samples~}/Stocks/CA_Stock_Parent_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Stocks.meta +8 -8
- package/{Samples → Samples~}/UI/CA_Trial_Timer_Canvas_Template.prefab +229 -229
- package/{Samples → Samples~}/UI/CA_Trial_Timer_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/UI/CA_UI_Background_ETemplate.prefab +86 -86
- package/{Samples → Samples~}/UI/CA_UI_Background_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/UI/CA_UI_Pages_Decorations_Template.prefab +109 -109
- package/{Samples → Samples~}/UI/CA_UI_Pages_Decorations_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/UI/CA_UI_Stock_Panel_ETemplate.prefab +464 -464
- package/{Samples → Samples~}/UI/CA_UI_Stock_Panel_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/UI/CA_UI_Template.prefab +261 -261
- package/{Samples → Samples~}/UI/CA_UI_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/UI/Page_Counter_UI_ETemplate.prefab +831 -831
- package/{Samples → Samples~}/UI/Page_Counter_UI_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/UI.meta +8 -8
- package/Stocks/ActiveStockPanel.cs +177 -177
- package/Stocks/ActiveStockPanel.cs.meta +11 -11
- package/Stocks/ActiveStockPanelBase.cs +80 -80
- package/Stocks/ActiveStockPanelBase.cs.meta +11 -11
- package/Stocks/ActiveStockPanelStateable.cs +142 -142
- package/Stocks/ActiveStockPanelStateable.cs.meta +11 -11
- package/Stocks/ClosingArgumentStock.cs +120 -120
- package/Stocks/ClosingArgumentStock.cs.meta +11 -11
- package/Stocks/ShootCAStockVisibility.cs +133 -133
- package/Stocks/ShootCAStockVisibility.cs.meta +1 -1
- package/Stocks/StockParent.cs +127 -127
- package/Stocks/StockParent.cs.meta +11 -11
- package/Stocks.meta +8 -8
- package/package.json +46 -41
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
// Original Author: Henry (Meowpixel)
|
|
2
|
-
// Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
using UnityEngine.Events;
|
|
5
|
-
using UnityEngine.InputSystem;
|
|
6
|
-
|
|
7
|
-
namespace DREditor.Minigames.CA.Stocks
|
|
8
|
-
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
///
|
|
11
|
-
/// </summary>
|
|
12
|
-
public abstract class ActiveStockPanelStateable : ActiveStockPanelBase, ILockPreview
|
|
13
|
-
{
|
|
14
|
-
/// <summary>
|
|
15
|
-
///
|
|
16
|
-
/// </summary>
|
|
17
|
-
[Tooltip("")]
|
|
18
|
-
[SerializeField] protected InputActionReference move = null;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[Header("")]
|
|
22
|
-
[SerializeField] protected UnityEvent OnStockScrolled;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[Header("")]
|
|
26
|
-
[SerializeField] protected UnityEvent OnStockUnlocked;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/// <inheritdoc/>
|
|
30
|
-
public override void ActivateControls() => move.action.performed += StockMovement;
|
|
31
|
-
|
|
32
|
-
/// <inheritdoc/>
|
|
33
|
-
public override void DeactivateControls() => move.action.performed -= StockMovement;
|
|
34
|
-
|
|
35
|
-
/// <summary>
|
|
36
|
-
///
|
|
37
|
-
/// </summary>
|
|
38
|
-
/// <param name="context"></param>
|
|
39
|
-
protected virtual void StockMovement(InputAction.CallbackContext context)
|
|
40
|
-
{
|
|
41
|
-
Vector2 input = context.ReadValue<Vector2>();
|
|
42
|
-
|
|
43
|
-
int dirIndex;
|
|
44
|
-
|
|
45
|
-
if (input.x == 0)
|
|
46
|
-
dirIndex = (input.y > 0) ? 0 : 2; // Up and Down.
|
|
47
|
-
else
|
|
48
|
-
dirIndex = (input.x > 0) ? 1 : 3; // Right and Left.
|
|
49
|
-
|
|
50
|
-
if (currentStock.nodeDirections[dirIndex] == null) // if direction pressed leads to null pointer.
|
|
51
|
-
return;
|
|
52
|
-
|
|
53
|
-
OnStockUpdated(currentStock.nodeDirections[dirIndex]);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/// <summary>
|
|
57
|
-
///
|
|
58
|
-
/// </summary>
|
|
59
|
-
/// <param name="newStock"></param>
|
|
60
|
-
protected virtual void OnStockUpdated(ClosingArgumentStockBase newStock)
|
|
61
|
-
{
|
|
62
|
-
currentStock.SetHover(false);
|
|
63
|
-
|
|
64
|
-
SetCurrentStock(newStock);
|
|
65
|
-
|
|
66
|
-
currentStock.SetHover(true);
|
|
67
|
-
|
|
68
|
-
UpdatePanelState();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/// <summary>
|
|
72
|
-
///
|
|
73
|
-
/// </summary>
|
|
74
|
-
protected virtual void UpdatePanelState()
|
|
75
|
-
{
|
|
76
|
-
OnStockScrolled?.Invoke();
|
|
77
|
-
|
|
78
|
-
// Change activePanel visuals based on status of hovered stock
|
|
79
|
-
if (currentStock.selectable) // stock is unlocked and unsolved
|
|
80
|
-
OnStockUnsolved();
|
|
81
|
-
else if (currentStock.Solved)
|
|
82
|
-
OnStockSolved();
|
|
83
|
-
else if (currentStock.ToBeUnlocked)
|
|
84
|
-
OnStockUnlock();
|
|
85
|
-
else
|
|
86
|
-
OnStockLocked();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/// <summary>
|
|
91
|
-
///
|
|
92
|
-
/// </summary>
|
|
93
|
-
protected abstract void OnStockLocked();
|
|
94
|
-
|
|
95
|
-
/// <summary>
|
|
96
|
-
///
|
|
97
|
-
/// </summary>
|
|
98
|
-
protected abstract void OnStockUnsolved();
|
|
99
|
-
|
|
100
|
-
/// <summary>
|
|
101
|
-
///
|
|
102
|
-
/// </summary>
|
|
103
|
-
protected virtual void OnStockUnlock() => OnStockUnlocked?.Invoke();
|
|
104
|
-
|
|
105
|
-
/// <summary>
|
|
106
|
-
///
|
|
107
|
-
/// </summary>
|
|
108
|
-
protected abstract void OnStockSolved();
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/// <inheritdoc/>
|
|
112
|
-
public override void OnStockCorrect(Transform hoveredObject) => currentStock.Solve();
|
|
113
|
-
|
|
114
|
-
/// <inheritdoc/>
|
|
115
|
-
public override void InitializeActivePanel(int stockIndex)
|
|
116
|
-
{
|
|
117
|
-
base.InitializeActivePanel(stockIndex);
|
|
118
|
-
|
|
119
|
-
InitializePanelState();
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/// <summary>
|
|
123
|
-
///
|
|
124
|
-
/// </summary>
|
|
125
|
-
protected virtual void InitializePanelState()
|
|
126
|
-
{
|
|
127
|
-
if (currentStock.ToBeUnlocked ||
|
|
128
|
-
currentStock.IsUnlocked ||
|
|
129
|
-
currentStock.Solved)
|
|
130
|
-
OnStockUnsolved();
|
|
131
|
-
else
|
|
132
|
-
OnStockLocked();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/// <inheritdoc/>
|
|
137
|
-
public virtual void PreviewLockState(bool previewLockState)
|
|
138
|
-
{
|
|
139
|
-
if (!previewLockState)
|
|
140
|
-
OnStockUnsolved();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
1
|
+
// Original Author: Henry (Meowpixel)
|
|
2
|
+
// Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using UnityEngine.Events;
|
|
5
|
+
using UnityEngine.InputSystem;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Minigames.CA.Stocks
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
public abstract class ActiveStockPanelStateable : ActiveStockPanelBase, ILockPreview
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SerializeField] protected InputActionReference move = null;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[Header("")]
|
|
22
|
+
[SerializeField] protected UnityEvent OnStockScrolled;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
[Header("")]
|
|
26
|
+
[SerializeField] protected UnityEvent OnStockUnlocked;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/// <inheritdoc/>
|
|
30
|
+
public override void ActivateControls() => move.action.performed += StockMovement;
|
|
31
|
+
|
|
32
|
+
/// <inheritdoc/>
|
|
33
|
+
public override void DeactivateControls() => move.action.performed -= StockMovement;
|
|
34
|
+
|
|
35
|
+
/// <summary>
|
|
36
|
+
///
|
|
37
|
+
/// </summary>
|
|
38
|
+
/// <param name="context"></param>
|
|
39
|
+
protected virtual void StockMovement(InputAction.CallbackContext context)
|
|
40
|
+
{
|
|
41
|
+
Vector2 input = context.ReadValue<Vector2>();
|
|
42
|
+
|
|
43
|
+
int dirIndex;
|
|
44
|
+
|
|
45
|
+
if (input.x == 0)
|
|
46
|
+
dirIndex = (input.y > 0) ? 0 : 2; // Up and Down.
|
|
47
|
+
else
|
|
48
|
+
dirIndex = (input.x > 0) ? 1 : 3; // Right and Left.
|
|
49
|
+
|
|
50
|
+
if (currentStock.nodeDirections[dirIndex] == null) // if direction pressed leads to null pointer.
|
|
51
|
+
return;
|
|
52
|
+
|
|
53
|
+
OnStockUpdated(currentStock.nodeDirections[dirIndex]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
///
|
|
58
|
+
/// </summary>
|
|
59
|
+
/// <param name="newStock"></param>
|
|
60
|
+
protected virtual void OnStockUpdated(ClosingArgumentStockBase newStock)
|
|
61
|
+
{
|
|
62
|
+
currentStock.SetHover(false);
|
|
63
|
+
|
|
64
|
+
SetCurrentStock(newStock);
|
|
65
|
+
|
|
66
|
+
currentStock.SetHover(true);
|
|
67
|
+
|
|
68
|
+
UpdatePanelState();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// <summary>
|
|
72
|
+
///
|
|
73
|
+
/// </summary>
|
|
74
|
+
protected virtual void UpdatePanelState()
|
|
75
|
+
{
|
|
76
|
+
OnStockScrolled?.Invoke();
|
|
77
|
+
|
|
78
|
+
// Change activePanel visuals based on status of hovered stock
|
|
79
|
+
if (currentStock.selectable) // stock is unlocked and unsolved
|
|
80
|
+
OnStockUnsolved();
|
|
81
|
+
else if (currentStock.Solved)
|
|
82
|
+
OnStockSolved();
|
|
83
|
+
else if (currentStock.ToBeUnlocked)
|
|
84
|
+
OnStockUnlock();
|
|
85
|
+
else
|
|
86
|
+
OnStockLocked();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/// <summary>
|
|
91
|
+
///
|
|
92
|
+
/// </summary>
|
|
93
|
+
protected abstract void OnStockLocked();
|
|
94
|
+
|
|
95
|
+
/// <summary>
|
|
96
|
+
///
|
|
97
|
+
/// </summary>
|
|
98
|
+
protected abstract void OnStockUnsolved();
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
///
|
|
102
|
+
/// </summary>
|
|
103
|
+
protected virtual void OnStockUnlock() => OnStockUnlocked?.Invoke();
|
|
104
|
+
|
|
105
|
+
/// <summary>
|
|
106
|
+
///
|
|
107
|
+
/// </summary>
|
|
108
|
+
protected abstract void OnStockSolved();
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/// <inheritdoc/>
|
|
112
|
+
public override void OnStockCorrect(Transform hoveredObject) => currentStock.Solve();
|
|
113
|
+
|
|
114
|
+
/// <inheritdoc/>
|
|
115
|
+
public override void InitializeActivePanel(int stockIndex)
|
|
116
|
+
{
|
|
117
|
+
base.InitializeActivePanel(stockIndex);
|
|
118
|
+
|
|
119
|
+
InitializePanelState();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/// <summary>
|
|
123
|
+
///
|
|
124
|
+
/// </summary>
|
|
125
|
+
protected virtual void InitializePanelState()
|
|
126
|
+
{
|
|
127
|
+
if (currentStock.ToBeUnlocked ||
|
|
128
|
+
currentStock.IsUnlocked ||
|
|
129
|
+
currentStock.Solved)
|
|
130
|
+
OnStockUnsolved();
|
|
131
|
+
else
|
|
132
|
+
OnStockLocked();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
/// <inheritdoc/>
|
|
137
|
+
public virtual void PreviewLockState(bool previewLockState)
|
|
138
|
+
{
|
|
139
|
+
if (!previewLockState)
|
|
140
|
+
OnStockUnsolved();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
143
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 63bd5ec8fb2657d4c859bde0688b4cfa
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 63bd5ec8fb2657d4c859bde0688b4cfa
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
// Original Author: Henry (Meowpixel)
|
|
2
|
-
// Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
|
|
5
|
-
namespace DREditor.Minigames.CA.Stocks
|
|
6
|
-
{
|
|
7
|
-
/// <summary>
|
|
8
|
-
///
|
|
9
|
-
/// </summary>
|
|
10
|
-
[ClassHeader(nameof(ClosingArgumentStockBase) + ", " + nameof(ILockPreview) +
|
|
11
|
-
"\n\n")]
|
|
12
|
-
public class ClosingArgumentStock : ClosingArgumentStockBase
|
|
13
|
-
{
|
|
14
|
-
/// <summary>
|
|
15
|
-
///
|
|
16
|
-
/// </summary>
|
|
17
|
-
[Header("")]
|
|
18
|
-
[Tooltip("")]
|
|
19
|
-
[SerializeField] protected SpriteRenderer spriteRenderer = null;
|
|
20
|
-
|
|
21
|
-
/// <summary>
|
|
22
|
-
///
|
|
23
|
-
/// </summary>
|
|
24
|
-
[Tooltip("")]
|
|
25
|
-
[SerializeField] protected SpriteMask spriteMask = null;
|
|
26
|
-
|
|
27
|
-
/// <summary>
|
|
28
|
-
///
|
|
29
|
-
/// </summary>
|
|
30
|
-
[Tooltip("")]
|
|
31
|
-
[SerializeField] protected SpriteRenderer overlaySpriteRenderer = null;
|
|
32
|
-
|
|
33
|
-
/// <summary>
|
|
34
|
-
///
|
|
35
|
-
/// </summary>
|
|
36
|
-
[Tooltip("")]
|
|
37
|
-
[SerializeField] protected Sprite unlockSprite = null;
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
[Tooltip("")]
|
|
43
|
-
[SerializeField] protected Sprite lockSprite = null;
|
|
44
|
-
|
|
45
|
-
/// <summary>
|
|
46
|
-
///
|
|
47
|
-
/// </summary>
|
|
48
|
-
[Tooltip("")]
|
|
49
|
-
[SerializeField] protected Sprite completeSprite = null;
|
|
50
|
-
|
|
51
|
-
/// <summary>
|
|
52
|
-
///
|
|
53
|
-
/// </summary>
|
|
54
|
-
[Tooltip("")]
|
|
55
|
-
[SerializeField] protected GameObject hoverObject = null;
|
|
56
|
-
|
|
57
|
-
/// <summary>
|
|
58
|
-
///
|
|
59
|
-
/// </summary>
|
|
60
|
-
[Tooltip("")]
|
|
61
|
-
[SerializeField] protected GameObject clickedObject = null;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/// <inheritdoc/>
|
|
65
|
-
public override void SetStockVisual(object obj)
|
|
66
|
-
{
|
|
67
|
-
if (obj is Sprite sprite && spriteRenderer != null)
|
|
68
|
-
{
|
|
69
|
-
spriteRenderer.sprite = sprite;
|
|
70
|
-
|
|
71
|
-
spriteRenderer.sortingOrder = transform.GetSiblingIndex();
|
|
72
|
-
|
|
73
|
-
spriteMask.frontSortingOrder = transform.GetSiblingIndex();
|
|
74
|
-
|
|
75
|
-
if (spriteMask.frontSortingOrder == 0)
|
|
76
|
-
spriteMask.backSortingOrder = -1;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/// <inheritdoc/>
|
|
81
|
-
public override object GetStockVisual() => spriteRenderer.sprite;
|
|
82
|
-
|
|
83
|
-
/// <inheritdoc/>
|
|
84
|
-
public override void UpdateLockState()
|
|
85
|
-
{
|
|
86
|
-
base.UpdateLockState();
|
|
87
|
-
|
|
88
|
-
Sprite lockStateSprite = (IsUnlocked || ToBeUnlocked) ? unlockSprite : lockSprite;
|
|
89
|
-
|
|
90
|
-
if (Solved)
|
|
91
|
-
lockStateSprite = completeSprite;
|
|
92
|
-
|
|
93
|
-
overlaySpriteRenderer.sprite = lockStateSprite;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/// <inheritdoc/>
|
|
97
|
-
public override void SetHover(bool isHovering) => SetObjectActive(hoverObject, isHovering);
|
|
98
|
-
|
|
99
|
-
/// <inheritdoc/>
|
|
100
|
-
public override void SetClicked(bool isClicked) => SetObjectActive(clickedObject, isClicked);
|
|
101
|
-
|
|
102
|
-
/// <summary>
|
|
103
|
-
///
|
|
104
|
-
/// </summary>
|
|
105
|
-
/// <param name="go"></param>
|
|
106
|
-
/// <param name="condition"></param>
|
|
107
|
-
protected virtual void SetObjectActive(GameObject go, bool condition)
|
|
108
|
-
{
|
|
109
|
-
if (go != null)
|
|
110
|
-
go.SetActive(condition);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/// <inheritdoc/>
|
|
114
|
-
public override void CAReset()
|
|
115
|
-
{
|
|
116
|
-
base.CAReset();
|
|
117
|
-
|
|
118
|
-
SetHover(false);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
1
|
+
// Original Author: Henry (Meowpixel)
|
|
2
|
+
// Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.Minigames.CA.Stocks
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
[ClassHeader(nameof(ClosingArgumentStockBase) + ", " + nameof(ILockPreview) +
|
|
11
|
+
"\n\n")]
|
|
12
|
+
public class ClosingArgumentStock : ClosingArgumentStockBase
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Header("")]
|
|
18
|
+
[Tooltip("")]
|
|
19
|
+
[SerializeField] protected SpriteRenderer spriteRenderer = null;
|
|
20
|
+
|
|
21
|
+
/// <summary>
|
|
22
|
+
///
|
|
23
|
+
/// </summary>
|
|
24
|
+
[Tooltip("")]
|
|
25
|
+
[SerializeField] protected SpriteMask spriteMask = null;
|
|
26
|
+
|
|
27
|
+
/// <summary>
|
|
28
|
+
///
|
|
29
|
+
/// </summary>
|
|
30
|
+
[Tooltip("")]
|
|
31
|
+
[SerializeField] protected SpriteRenderer overlaySpriteRenderer = null;
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
///
|
|
35
|
+
/// </summary>
|
|
36
|
+
[Tooltip("")]
|
|
37
|
+
[SerializeField] protected Sprite unlockSprite = null;
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Tooltip("")]
|
|
43
|
+
[SerializeField] protected Sprite lockSprite = null;
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
///
|
|
47
|
+
/// </summary>
|
|
48
|
+
[Tooltip("")]
|
|
49
|
+
[SerializeField] protected Sprite completeSprite = null;
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
///
|
|
53
|
+
/// </summary>
|
|
54
|
+
[Tooltip("")]
|
|
55
|
+
[SerializeField] protected GameObject hoverObject = null;
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
[Tooltip("")]
|
|
61
|
+
[SerializeField] protected GameObject clickedObject = null;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/// <inheritdoc/>
|
|
65
|
+
public override void SetStockVisual(object obj)
|
|
66
|
+
{
|
|
67
|
+
if (obj is Sprite sprite && spriteRenderer != null)
|
|
68
|
+
{
|
|
69
|
+
spriteRenderer.sprite = sprite;
|
|
70
|
+
|
|
71
|
+
spriteRenderer.sortingOrder = transform.GetSiblingIndex();
|
|
72
|
+
|
|
73
|
+
spriteMask.frontSortingOrder = transform.GetSiblingIndex();
|
|
74
|
+
|
|
75
|
+
if (spriteMask.frontSortingOrder == 0)
|
|
76
|
+
spriteMask.backSortingOrder = -1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <inheritdoc/>
|
|
81
|
+
public override object GetStockVisual() => spriteRenderer.sprite;
|
|
82
|
+
|
|
83
|
+
/// <inheritdoc/>
|
|
84
|
+
public override void UpdateLockState()
|
|
85
|
+
{
|
|
86
|
+
base.UpdateLockState();
|
|
87
|
+
|
|
88
|
+
Sprite lockStateSprite = (IsUnlocked || ToBeUnlocked) ? unlockSprite : lockSprite;
|
|
89
|
+
|
|
90
|
+
if (Solved)
|
|
91
|
+
lockStateSprite = completeSprite;
|
|
92
|
+
|
|
93
|
+
overlaySpriteRenderer.sprite = lockStateSprite;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/// <inheritdoc/>
|
|
97
|
+
public override void SetHover(bool isHovering) => SetObjectActive(hoverObject, isHovering);
|
|
98
|
+
|
|
99
|
+
/// <inheritdoc/>
|
|
100
|
+
public override void SetClicked(bool isClicked) => SetObjectActive(clickedObject, isClicked);
|
|
101
|
+
|
|
102
|
+
/// <summary>
|
|
103
|
+
///
|
|
104
|
+
/// </summary>
|
|
105
|
+
/// <param name="go"></param>
|
|
106
|
+
/// <param name="condition"></param>
|
|
107
|
+
protected virtual void SetObjectActive(GameObject go, bool condition)
|
|
108
|
+
{
|
|
109
|
+
if (go != null)
|
|
110
|
+
go.SetActive(condition);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/// <inheritdoc/>
|
|
114
|
+
public override void CAReset()
|
|
115
|
+
{
|
|
116
|
+
base.CAReset();
|
|
117
|
+
|
|
118
|
+
SetHover(false);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
121
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 8745b6c17f7650b438e54fba4ae4f158
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 8745b6c17f7650b438e54fba4ae4f158
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|