net.dreditor.minigames.ca 0.0.0-stage → 0.1.7

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.
Files changed (193) hide show
  1. package/.attestation.p7m +0 -0
  2. package/ArgumentBuilder.cs +81 -0
  3. package/ArgumentBuilder.cs.meta +11 -0
  4. package/ArgumentPage.cs +37 -0
  5. package/ArgumentPage.cs.meta +11 -0
  6. package/ArgumentQuestionPanel.cs +137 -0
  7. package/ArgumentQuestionPanel.cs.meta +11 -0
  8. package/ClosingArgumentSettings.cs +24 -0
  9. package/ClosingArgumentSettings.cs.meta +11 -0
  10. package/ClosingArgumentStockBase.cs +251 -0
  11. package/ClosingArgumentStockBase.cs.meta +11 -0
  12. package/DREditor.Minigames.CA.asmdef +25 -0
  13. package/DREditor.Minigames.CA.asmdef.meta +7 -0
  14. package/Editor/ArgumentBuilderEditor.cs +140 -0
  15. package/Editor/ArgumentBuilderEditor.cs.meta +12 -0
  16. package/Editor/ArgumentPageEditor.cs +284 -0
  17. package/Editor/ArgumentPageEditor.cs.meta +11 -0
  18. package/Editor/ArgumentPanelEditor.cs +142 -0
  19. package/Editor/ArgumentPanelEditor.cs.meta +11 -0
  20. package/Editor/ArgumentStockEditor.cs +168 -0
  21. package/Editor/ArgumentStockEditor.cs.meta +11 -0
  22. package/Editor/CAHandyFields.cs +33 -0
  23. package/Editor/CAHandyFields.cs.meta +2 -0
  24. package/Editor/DREditor.Minigames.CA.Editor.asmdef +21 -0
  25. package/Editor/DREditor.Minigames.CA.Editor.asmdef.meta +7 -0
  26. package/Editor/PreviewableArgumentBuilderEditor.cs +287 -0
  27. package/Editor/PreviewableArgumentBuilderEditor.cs.meta +12 -0
  28. package/Editor.meta +8 -0
  29. package/IActiveStockPanel.cs +37 -0
  30. package/IActiveStockPanel.cs.meta +11 -0
  31. package/IArgumentPreviewInitializer.cs +20 -0
  32. package/IArgumentPreviewInitializer.cs.meta +11 -0
  33. package/IClosingArgumentListener.cs +18 -0
  34. package/IClosingArgumentListener.cs.meta +11 -0
  35. package/IClosingArgumentPagePreviewer.cs +17 -0
  36. package/IClosingArgumentPagePreviewer.cs.meta +11 -0
  37. package/IClosingArgumentResetable.cs +16 -0
  38. package/IClosingArgumentResetable.cs.meta +11 -0
  39. package/ILockPreview.cs +17 -0
  40. package/ILockPreview.cs.meta +11 -0
  41. package/IPageListener.cs +18 -0
  42. package/IPageListener.cs.meta +11 -0
  43. package/IPagesInitializer.cs +18 -0
  44. package/IPagesInitializer.cs.meta +11 -0
  45. package/ITotalStockListener.cs +17 -0
  46. package/ITotalStockListener.cs.meta +11 -0
  47. package/Managers/ArgumentInitializerBase.cs +18 -0
  48. package/Managers/ArgumentInitializerBase.cs.meta +11 -0
  49. package/Managers/ClosingArgumentInitializer.cs +129 -0
  50. package/Managers/ClosingArgumentInitializer.cs.meta +11 -0
  51. package/Managers/ClosingArgumentManager.cs +270 -0
  52. package/Managers/ClosingArgumentManager.cs.meta +11 -0
  53. package/Managers/ClosingArgumentManagerBase.cs +147 -0
  54. package/Managers/ClosingArgumentManagerBase.cs.meta +11 -0
  55. package/Managers/ClosingArgumentPreviewInitializer.cs +81 -0
  56. package/Managers/ClosingArgumentPreviewInitializer.cs.meta +18 -0
  57. package/Managers.meta +8 -0
  58. package/Pages/IPageInitializer.cs +24 -0
  59. package/Pages/IPageInitializer.cs.meta +11 -0
  60. package/Pages/MainPagePreviewer.cs +67 -0
  61. package/Pages/MainPagePreviewer.cs.meta +11 -0
  62. package/Pages/MiniPageInitializer.cs +145 -0
  63. package/Pages/MiniPageInitializer.cs.meta +11 -0
  64. package/Pages/MoveMainPagesComponent.cs +164 -0
  65. package/Pages/MoveMainPagesComponent.cs.meta +11 -0
  66. package/Pages/MovePageComponent.cs +105 -0
  67. package/Pages/MovePageComponent.cs.meta +11 -0
  68. package/Pages/MovePageHandler.cs +216 -0
  69. package/Pages/MovePageHandler.cs.meta +11 -0
  70. package/Pages/PageArrows.cs +125 -0
  71. package/Pages/PageArrows.cs.meta +11 -0
  72. package/Pages/PageCounter.cs +66 -0
  73. package/Pages/PageCounter.cs.meta +11 -0
  74. package/Pages/PageHandlerBase.cs +31 -0
  75. package/Pages/PageHandlerBase.cs.meta +11 -0
  76. package/Pages/PageInitializer.cs +196 -0
  77. package/Pages/PageInitializer.cs.meta +11 -0
  78. package/Pages/PageInitializerBase.cs +66 -0
  79. package/Pages/PageInitializerBase.cs.meta +11 -0
  80. package/Pages/PagePreviewer.cs +58 -0
  81. package/Pages/PagePreviewer.cs.meta +11 -0
  82. package/Pages.meta +8 -0
  83. package/PanelInitializerBase.cs +148 -0
  84. package/PanelInitializerBase.cs.meta +11 -0
  85. package/Panels/ClosingArgumentReticle.cs +170 -0
  86. package/Panels/ClosingArgumentReticle.cs.meta +11 -0
  87. package/Panels/ClosingArgumentShooter.cs +154 -0
  88. package/Panels/ClosingArgumentShooter.cs.meta +11 -0
  89. package/Panels/CorrectMiniPanelUpdater.cs +46 -0
  90. package/Panels/CorrectMiniPanelUpdater.cs.meta +11 -0
  91. package/Panels/CorrectPanelUpdater.cs +25 -0
  92. package/Panels/CorrectPanelUpdater.cs.meta +11 -0
  93. package/Panels/PanelInitializer.cs +52 -0
  94. package/Panels/PanelInitializer.cs.meta +11 -0
  95. package/Panels/PreviewPanelInitializer.cs +59 -0
  96. package/Panels/PreviewPanelInitializer.cs.meta +11 -0
  97. package/Panels/QuestionPanel.cs +144 -0
  98. package/Panels/QuestionPanel.cs.meta +11 -0
  99. package/Panels/QuestionPanelBase.cs +69 -0
  100. package/Panels/QuestionPanelBase.cs.meta +11 -0
  101. package/Panels.meta +8 -0
  102. package/Samples~/CACameraEnabled.asset +21 -0
  103. package/Samples~/CACameraEnabled.asset.meta +8 -0
  104. package/Samples~/CAPanelTarget.asset +25 -0
  105. package/Samples~/CAPanelTarget.asset.meta +8 -0
  106. package/Samples~/CAResult.asset +21 -0
  107. package/Samples~/CAResult.asset.meta +8 -0
  108. package/Samples~/CA_Animations/CA_Page_Square/Being Hidden Top.anim +600 -0
  109. package/Samples~/CA_Animations/CA_Page_Square/Being Hidden Top.anim.meta +8 -0
  110. package/Samples~/CA_Animations/CA_Page_Square/Being Hidden.anim +600 -0
  111. package/Samples~/CA_Animations/CA_Page_Square/Being Hidden.anim.meta +8 -0
  112. package/Samples~/CA_Animations/CA_Page_Square/Being Shown Top.anim +600 -0
  113. package/Samples~/CA_Animations/CA_Page_Square/Being Shown Top.anim.meta +8 -0
  114. package/Samples~/CA_Animations/CA_Page_Square/Being Shown.anim +582 -0
  115. package/Samples~/CA_Animations/CA_Page_Square/Being Shown.anim.meta +8 -0
  116. package/Samples~/CA_Animations/CA_Page_Square/Mystery Square.controller +188 -0
  117. package/Samples~/CA_Animations/CA_Page_Square/Mystery Square.controller.meta +8 -0
  118. package/Samples~/CA_Animations/CA_Page_Square.meta +8 -0
  119. package/Samples~/CA_Animations.meta +8 -0
  120. package/Samples~/Managers/CA_Camera.prefab +159 -0
  121. package/Samples~/Managers/CA_Camera.prefab.meta +7 -0
  122. package/Samples~/Managers/CA_Camera_Canvas.prefab +195 -0
  123. package/Samples~/Managers/CA_Camera_Canvas.prefab.meta +7 -0
  124. package/Samples~/Managers/CA_Manager_Preview_Shell.prefab +267 -0
  125. package/Samples~/Managers/CA_Manager_Preview_Shell.prefab.meta +7 -0
  126. package/Samples~/Managers/CA_Manager_Preview_Template.prefab +613 -0
  127. package/Samples~/Managers/CA_Manager_Preview_Template.prefab.meta +7 -0
  128. package/Samples~/Managers/CA_Manager_Shell.prefab +443 -0
  129. package/Samples~/Managers/CA_Manager_Shell.prefab.meta +7 -0
  130. package/Samples~/Managers/CA_Manager_Template.prefab +709 -0
  131. package/Samples~/Managers/CA_Manager_Template.prefab.meta +7 -0
  132. package/Samples~/Managers/CA_Result_UI_ETemplate.prefab +433 -0
  133. package/Samples~/Managers/CA_Result_UI_ETemplate.prefab.meta +7 -0
  134. package/Samples~/Managers.meta +8 -0
  135. package/Samples~/Pages/CA_Colliders.prefab +305 -0
  136. package/Samples~/Pages/CA_Colliders.prefab.meta +7 -0
  137. package/Samples~/Pages/CA_Main_Page_Arrows_ETemplate.prefab +221 -0
  138. package/Samples~/Pages/CA_Main_Page_Arrows_ETemplate.prefab.meta +7 -0
  139. package/Samples~/Pages/CA_Page_Gameplay_Shell.prefab +435 -0
  140. package/Samples~/Pages/CA_Page_Gameplay_Shell.prefab.meta +7 -0
  141. package/Samples~/Pages/CA_Page_Gameplay_Template.prefab +220 -0
  142. package/Samples~/Pages/CA_Page_Gameplay_Template.prefab.meta +7 -0
  143. package/Samples~/Pages/CA_Reticle_ETemplate.prefab +337 -0
  144. package/Samples~/Pages/CA_Reticle_ETemplate.prefab.meta +7 -0
  145. package/Samples~/Pages/CA_Reticle_Shooter_Template.prefab +148 -0
  146. package/Samples~/Pages/CA_Reticle_Shooter_Template.prefab.meta +7 -0
  147. package/Samples~/Pages/Mystery_Square_ETemplate.prefab +857 -0
  148. package/Samples~/Pages/Mystery_Square_ETemplate.prefab.meta +7 -0
  149. package/Samples~/Pages/Page_Add_Ons_ETemplate.prefab +203 -0
  150. package/Samples~/Pages/Page_Add_Ons_ETemplate.prefab.meta +7 -0
  151. package/Samples~/Pages/Page_ETemplate.prefab +256 -0
  152. package/Samples~/Pages/Page_ETemplate.prefab.meta +7 -0
  153. package/Samples~/Pages.meta +8 -0
  154. package/Samples~/Stocks/CA_Stock_Display_Shell.prefab +110 -0
  155. package/Samples~/Stocks/CA_Stock_Display_Shell.prefab.meta +7 -0
  156. package/Samples~/Stocks/CA_Stock_Display_Template.prefab +731 -0
  157. package/Samples~/Stocks/CA_Stock_Display_Template.prefab.meta +7 -0
  158. package/Samples~/Stocks/CA_Stock_ETemplate.prefab +427 -0
  159. package/Samples~/Stocks/CA_Stock_ETemplate.prefab.meta +7 -0
  160. package/Samples~/Stocks/CA_Stock_Parent_Shell.prefab +61 -0
  161. package/Samples~/Stocks/CA_Stock_Parent_Shell.prefab.meta +7 -0
  162. package/Samples~/Stocks/CA_Stock_Parent_Template.prefab +1017 -0
  163. package/Samples~/Stocks/CA_Stock_Parent_Template.prefab.meta +7 -0
  164. package/Samples~/Stocks.meta +8 -0
  165. package/Samples~/UI/CA_Trial_Timer_Canvas_Template.prefab +229 -0
  166. package/Samples~/UI/CA_Trial_Timer_Canvas_Template.prefab.meta +7 -0
  167. package/Samples~/UI/CA_UI_Background_ETemplate.prefab +86 -0
  168. package/Samples~/UI/CA_UI_Background_ETemplate.prefab.meta +7 -0
  169. package/Samples~/UI/CA_UI_Pages_Decorations_Template.prefab +109 -0
  170. package/Samples~/UI/CA_UI_Pages_Decorations_Template.prefab.meta +7 -0
  171. package/Samples~/UI/CA_UI_Stock_Panel_ETemplate.prefab +464 -0
  172. package/Samples~/UI/CA_UI_Stock_Panel_ETemplate.prefab.meta +7 -0
  173. package/Samples~/UI/CA_UI_Template.prefab +261 -0
  174. package/Samples~/UI/CA_UI_Template.prefab.meta +7 -0
  175. package/Samples~/UI/Page_Counter_UI_ETemplate.prefab +831 -0
  176. package/Samples~/UI/Page_Counter_UI_ETemplate.prefab.meta +7 -0
  177. package/Samples~/UI.meta +8 -0
  178. package/Stocks/ActiveStockPanel.cs +178 -0
  179. package/Stocks/ActiveStockPanel.cs.meta +11 -0
  180. package/Stocks/ActiveStockPanelBase.cs +81 -0
  181. package/Stocks/ActiveStockPanelBase.cs.meta +11 -0
  182. package/Stocks/ActiveStockPanelStateable.cs +143 -0
  183. package/Stocks/ActiveStockPanelStateable.cs.meta +11 -0
  184. package/Stocks/ClosingArgumentStock.cs +121 -0
  185. package/Stocks/ClosingArgumentStock.cs.meta +11 -0
  186. package/Stocks/ShootCAStockVisibility.cs +134 -0
  187. package/Stocks/ShootCAStockVisibility.cs.meta +2 -0
  188. package/Stocks/StockParent.cs +128 -0
  189. package/Stocks/StockParent.cs.meta +11 -0
  190. package/Stocks.meta +8 -0
  191. package/package.json +44 -4
  192. package/package.json.meta +7 -0
  193. package/README.md +0 -3
Binary file
@@ -0,0 +1,81 @@
1
+ // Original Author: Henry (Meowpixel)
2
+ // Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
3
+ using System.Collections.Generic;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.Minigames.CA
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ [System.Serializable]
12
+ [CreateAssetMenu(menuName = "DREditor/Minigames/Closing Argument", fileName = "CA Builder")]
13
+ public class ArgumentBuilder : MinigameBuilderBase
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ public List<ArgumentPage> pages = new();
19
+
20
+
21
+ /// <summary>
22
+ ///
23
+ /// </summary>
24
+ /// <param name="page"></param>
25
+ /// <returns>
26
+ ///
27
+ /// </returns>
28
+ public virtual (int, int) GetPageBounds(ArgumentPage page)
29
+ {
30
+ int stockCount = 0;
31
+
32
+ for (int i = 0; i < pages.Count; i++)
33
+ {
34
+ if (pages[i].Equals(page))
35
+ return (stockCount, stockCount + pages[i].questionPanels.Count);
36
+
37
+ stockCount += pages[i].questionPanels.Count;
38
+ }
39
+
40
+ return (-1, -1);
41
+ }
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ /// <returns></returns>
47
+ public virtual int GetTotalStock()
48
+ {
49
+ int stockCount = 0;
50
+
51
+ for (int i = 0; i < pages.Count; i++)
52
+ stockCount += pages[i].questionPanels.Count;
53
+
54
+ return stockCount;
55
+ }
56
+
57
+ /// <summary>
58
+ ///
59
+ /// </summary>
60
+ /// <param name="stock"></param>
61
+ /// <returns>
62
+ ///
63
+ /// </returns>
64
+ public virtual int GetStockIndex(ArgumentQuestionPanel stock)
65
+ {
66
+ int stockCounter = 0;
67
+
68
+ for (int i = 0; i < pages.Count; i++)
69
+ {
70
+ int itemIndex = pages[i].questionPanels.IndexOf(stock);
71
+
72
+ if (itemIndex != -1)
73
+ return stockCounter + itemIndex;
74
+ else
75
+ stockCounter += pages[i].questionPanels.Count;
76
+ }
77
+
78
+ return -1;
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 08b6d3a0ddfb3814ea069881e729be0f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,37 @@
1
+ // Original Author: Henry (Meowpixel)
2
+ // Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
3
+ using System.Collections.Generic;
4
+ using UnityEngine;
5
+ using UnityEngine.Serialization;
6
+
7
+ namespace DREditor.Minigames.CA
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [System.Serializable]
13
+ public class ArgumentPage
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ public Sprite pageSprite;
19
+
20
+ /// <summary>
21
+ ///
22
+ /// </summary>
23
+ [FormerlySerializedAs("stock")]
24
+ public List<ArgumentQuestionPanel> questionPanels = new();
25
+
26
+ /// <summary>
27
+ ///
28
+ /// </summary>
29
+ /// <param name="pageSprite"></param>
30
+ public virtual void SetPageSprite(Sprite pageSprite) => this.pageSprite = pageSprite;
31
+
32
+ /// <summary>
33
+ ///
34
+ /// </summary>
35
+ public virtual void AddNewPanel() => questionPanels.Add(new());
36
+ }
37
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c7eea338877025a438823bb042fd5330
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,137 @@
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.Serialization;
5
+
6
+ namespace DREditor.Minigames.CA
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ [System.Serializable]
12
+ public class ArgumentQuestionPanel
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ public Sprite panelShape;
18
+
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ public Vector2 panelPos;
23
+
24
+ /// <summary>
25
+ ///
26
+ /// </summary>
27
+ public string questionText;
28
+
29
+ /// <summary>
30
+ ///
31
+ /// </summary>
32
+ public Vector2 symbolOffset = new(0, 0);
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ public Vector2 symbolScale = new(1, 1);
38
+
39
+ /// <summary>
40
+ ///
41
+ /// </summary>
42
+ [FormerlySerializedAs("flavourText")]
43
+ public string flavorText;
44
+
45
+ /// <summary>
46
+ ///
47
+ /// </summary>
48
+ public int noOfLocks = 0;
49
+
50
+ /// <summary>
51
+ ///
52
+ /// </summary>
53
+ public Vector2 activeScale = new(1, 1);
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ public Vector2 activePosition;
59
+
60
+ /// <summary>
61
+ ///
62
+ /// </summary>
63
+ public Vector2 stockScale = new(1, 1);
64
+
65
+ /// <summary>
66
+ ///
67
+ /// </summary>
68
+ public Vector2 stockPosition;
69
+
70
+
71
+ /// <summary>
72
+ ///
73
+ /// </summary>
74
+ /// <param name="panelShape"></param>
75
+ public virtual void SetPanelShape(Sprite panelShape) => this.panelShape = panelShape;
76
+
77
+ /// <summary>
78
+ ///
79
+ /// </summary>
80
+ /// <param name="panelPos"></param>
81
+ public virtual void SetPanelPos(Vector2 panelPos) => this.panelPos = panelPos;
82
+
83
+ /// <summary>
84
+ ///
85
+ /// </summary>
86
+ /// <param name="questionText"></param>
87
+ public virtual void SetQuestionText(string questionText) => this.questionText = questionText;
88
+
89
+ /// <summary>
90
+ ///
91
+ /// </summary>
92
+ /// <param name="symbolOffset"></param>
93
+ public virtual void SetSymbolOffset(Vector2 symbolOffset) => this.symbolOffset = symbolOffset;
94
+
95
+ /// <summary>
96
+ ///
97
+ /// </summary>
98
+ /// <param name="symbolScale"></param>
99
+ public virtual void SetSymbolScale(Vector2 symbolScale) => this.symbolScale = symbolScale;
100
+
101
+ /// <summary>
102
+ ///
103
+ /// </summary>
104
+ /// <param name="flavorText"></param>
105
+ public virtual void SetFlavorText(string flavorText) => this.flavorText = flavorText;
106
+
107
+ /// <summary>
108
+ ///
109
+ /// </summary>
110
+ /// <param name="noOfLocks"></param>
111
+ public virtual void SetNoOfLocks(int noOfLocks) => this.noOfLocks = noOfLocks;
112
+
113
+ /// <summary>
114
+ ///
115
+ /// </summary>
116
+ /// <param name="activeScale"></param>
117
+ public virtual void SetActiveScale(Vector2 activeScale) => this.activeScale = activeScale;
118
+
119
+ /// <summary>
120
+ ///
121
+ /// </summary>
122
+ /// <param name="activePosition"></param>
123
+ public virtual void SetActivePosition(Vector2 activePosition) => this.activePosition = activePosition;
124
+
125
+ /// <summary>
126
+ ///
127
+ /// </summary>
128
+ /// <param name="stockScale"></param>
129
+ public virtual void SetStockScale(Vector2 stockScale) => this.stockScale = stockScale;
130
+
131
+ /// <summary>
132
+ ///
133
+ /// </summary>
134
+ /// <param name="stockPosition"></param>
135
+ public virtual void SetStockPosition(Vector2 stockPosition) => this.stockPosition = stockPosition;
136
+ }
137
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: ffd6ed6b8974b4a4d809cb9a40b6907f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,24 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System;
3
+ using UnityEngine;
4
+
5
+ namespace DREditor.Minigames.CA
6
+ {
7
+ /// <summary>
8
+ ///
9
+ /// </summary>
10
+ [Serializable]
11
+ public class ClosingArgumentSettings : ProjectSettingsData<ClosingArgumentSettings>
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [Tooltip("")]
17
+ [SerializeField] protected GameObject previewPrefab = null;
18
+
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ public virtual GameObject PreviewPrefab { get => previewPrefab; set => previewPrefab = value; }
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: f31d5960e516c5b4bad5cd5820f0c948
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,251 @@
1
+ // Original Author: Henry (Meowpixel)
2
+ // Updated/Reworked by: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
3
+ using DREditor.UI;
4
+ using System.Collections.Generic;
5
+ using UnityEngine;
6
+ using UnityEngine.Serialization;
7
+
8
+ namespace DREditor.Minigames.CA
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ public abstract class ClosingArgumentStockBase : MonoBehaviour, IClosingArgumentResetable, ILockPreview
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [Header("")]
19
+ [Divider]
20
+ [Tooltip("")]
21
+ [SerializeField] protected int unlockIndex = 0;
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ [Tooltip("")]
27
+ [SerializeField] protected int unlockedIndex = -1;
28
+
29
+ /// <summary>
30
+ ///
31
+ /// </summary>
32
+ [Tooltip("")]
33
+ [SerializeField] protected int completedIndex = -2;
34
+
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ [Header("")]
40
+ [Divider]
41
+ [Tooltip("")]
42
+ public List<ClosingArgumentStockBase> nodeDirections;
43
+
44
+ /// <summary>
45
+ ///
46
+ /// </summary>
47
+ [Tooltip("")]
48
+ [FormerlySerializedAs("flavourText")]
49
+ public string flavorText;
50
+
51
+ /// <summary>
52
+ ///
53
+ /// </summary>
54
+ [Tooltip("")]
55
+ public int remainingLocks;
56
+
57
+ /// <summary>
58
+ ///
59
+ /// </summary>
60
+ [Tooltip("")]
61
+ public bool selectable = true;
62
+
63
+
64
+
65
+ /// <summary>
66
+ ///
67
+ /// </summary>
68
+ [Tooltip("")]
69
+ public Vector2 activePanelScale;
70
+
71
+ /// <summary>
72
+ ///
73
+ /// </summary>
74
+ [Tooltip("")]
75
+ public Vector2 activePanelPos;
76
+
77
+
78
+ /// <summary>
79
+ ///
80
+ /// </summary>
81
+ public bool ToBeUnlocked { get; protected set; } = false;
82
+
83
+ /// <summary>
84
+ ///
85
+ /// </summary>
86
+ public bool IsUnlocked { get; protected set; } = false;
87
+
88
+ /// <summary>
89
+ ///
90
+ /// </summary>
91
+ public bool Solved { get; protected set; } = false;
92
+
93
+
94
+ /// <summary>
95
+ ///
96
+ /// </summary>
97
+ protected int totalLocks = -1;
98
+
99
+
100
+ /// <summary>
101
+ ///
102
+ /// </summary>
103
+ /// <param name="flavorText"></param>
104
+ public virtual void SetFlavorText(string flavorText) => this.flavorText = flavorText;
105
+
106
+ /// <summary>
107
+ ///
108
+ /// </summary>
109
+ /// <param name="totalLocks"></param>
110
+ public virtual void SetTotalLocks(int totalLocks)
111
+ {
112
+ this.totalLocks = totalLocks;
113
+
114
+ ResetRemainingLocks();
115
+ }
116
+
117
+ /// <summary>
118
+ ///
119
+ /// </summary>
120
+ public virtual void ResetRemainingLocks() => SetRemainingLocks(totalLocks);
121
+
122
+ /// <summary>
123
+ ///
124
+ /// </summary>
125
+ /// <param name="remainingLocks"></param>
126
+ public virtual void SetRemainingLocks(int remainingLocks)
127
+ {
128
+ this.remainingLocks = remainingLocks;
129
+
130
+ ToBeUnlocked = remainingLocks == unlockIndex;
131
+
132
+ IsUnlocked = remainingLocks == unlockedIndex;
133
+
134
+ Solved = remainingLocks == completedIndex;
135
+ }
136
+
137
+ /// <summary>
138
+ ///
139
+ /// </summary>
140
+ /// <param name="obj"></param>
141
+ public abstract void SetStockVisual(object obj);
142
+
143
+ /// <summary>
144
+ ///
145
+ /// </summary>
146
+ /// <returns></returns>
147
+ public abstract object GetStockVisual();
148
+
149
+ /// <summary>
150
+ ///
151
+ /// </summary>
152
+ /// <param name="activePanelScale"></param>
153
+ public virtual void SetActivePanelScale(Vector2 activePanelScale) => this.activePanelScale = activePanelScale;
154
+
155
+ /// <summary>
156
+ ///
157
+ /// </summary>
158
+ /// <param name="activePanelPos"></param>
159
+ public virtual void SetActivePanelPosition(Vector2 activePanelPos) => this.activePanelPos = activePanelPos;
160
+
161
+ /// <summary>
162
+ ///
163
+ /// </summary>
164
+ public virtual void Solve()
165
+ {
166
+ SetRemainingLocks(completedIndex);
167
+
168
+ UpdateLockState();
169
+
170
+ UpdateStockLocks();
171
+ }
172
+
173
+ /// <summary>
174
+ ///
175
+ /// </summary>
176
+ public virtual void UpdateLockState()
177
+ {
178
+ if ((IsUnlocked || ToBeUnlocked) && !Solved)
179
+ OnStockUnlocked();
180
+
181
+ selectable = !Solved && (IsUnlocked || ToBeUnlocked);
182
+ }
183
+
184
+ /// <summary>
185
+ ///
186
+ /// </summary>
187
+ protected virtual void OnStockUnlocked() => SetRemainingLocks(unlockedIndex);
188
+
189
+
190
+ /// <summary>
191
+ ///
192
+ /// </summary>
193
+ /// <param name="isHovering"></param>
194
+ public abstract void SetHover(bool isHovering);
195
+
196
+ /// <summary>
197
+ ///
198
+ /// </summary>
199
+ /// <param name="isClicked"></param>
200
+ public abstract void SetClicked(bool isClicked);
201
+
202
+ /// <inheritdoc/>
203
+ public virtual void CAReset() => SetRemainingLocks(completedIndex);
204
+
205
+ /// <summary>
206
+ ///
207
+ /// </summary>
208
+ public virtual void UpdateStockLocks()
209
+ {
210
+ //updates the remaining locks across each stock.
211
+ foreach (Transform child in transform.parent)
212
+ {
213
+ ClosingArgumentStockBase childStock = child.GetComponent<ClosingArgumentStockBase>();
214
+
215
+ if (childStock.remainingLocks > 0)
216
+ childStock.SetRemainingLocks(childStock.remainingLocks - 1);
217
+ }
218
+ }
219
+
220
+ /// <summary>
221
+ ///
222
+ /// </summary>
223
+ [ContextMenu("Rewire")]
224
+ public void Rewire()
225
+ {
226
+ nodeDirections.Clear();
227
+
228
+ nodeDirections = new(4);
229
+
230
+ var directions = RewireUINavigation.FindClosestTransforms(transform);
231
+
232
+ foreach (var direction in directions)
233
+ if (direction != null)
234
+ nodeDirections.Add(direction.GetComponent<ClosingArgumentStockBase>());
235
+ else
236
+ nodeDirections.Add(null);
237
+ }
238
+
239
+
240
+ /// <inheritdoc/>
241
+ public virtual void PreviewLockState(bool previewLockState)
242
+ {
243
+ if (!previewLockState)
244
+ {
245
+ SetRemainingLocks(0);
246
+
247
+ UpdateLockState();
248
+ }
249
+ }
250
+ }
251
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: d455bc72ad2efa543a4fda795a09902b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "DREditor.Minigames.CA",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "Unity.InputSystem",
6
+ "Unity.TextMeshPro",
7
+ "DREditor",
8
+ "DREditor.Editor",
9
+ "DREditor.Controls",
10
+ "DREditor.Fading",
11
+ "DREditor.Audio",
12
+ "DREditor.UI",
13
+ "DREditor.UIHandling",
14
+ "DREditor.Minigames"
15
+ ],
16
+ "includePlatforms": [],
17
+ "excludePlatforms": [],
18
+ "allowUnsafeCode": false,
19
+ "overrideReferences": false,
20
+ "precompiledReferences": [],
21
+ "autoReferenced": true,
22
+ "defineConstraints": [],
23
+ "versionDefines": [],
24
+ "noEngineReferences": false
25
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 8daed44e5a2bd2e498aa186575458d4d
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant: