net.dreditor.minigames.ss 0.1.6 → 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 (44) hide show
  1. package/.attestation.p7m +0 -0
  2. package/DREditor.Minigames.SS.asmdef +20 -20
  3. package/DREditor.Minigames.SS.asmdef.meta +7 -7
  4. package/{Samples → Samples~}/SS_CG.prefab +116 -116
  5. package/{Samples → Samples~}/SS_CG.prefab.meta +7 -7
  6. package/{Samples → Samples~}/SS_Canvas_Shell.prefab +99 -99
  7. package/{Samples → Samples~}/SS_Canvas_Shell.prefab.meta +7 -7
  8. package/{Samples → Samples~}/SS_Canvas_Template.prefab +841 -841
  9. package/{Samples → Samples~}/SS_Canvas_Template.prefab.meta +7 -7
  10. package/{Samples → Samples~}/SS_Intro_Template.prefab +79 -79
  11. package/{Samples → Samples~}/SS_Intro_Template.prefab.meta +7 -7
  12. package/{Samples → Samples~}/SS_Manager_Template.prefab +530 -530
  13. package/{Samples → Samples~}/SS_Manager_Template.prefab.meta +7 -7
  14. package/{Samples → Samples~}/SS_Reticle_Template.prefab +244 -244
  15. package/{Samples → Samples~}/SS_Reticle_Template.prefab.meta +7 -7
  16. package/Spot.cs +85 -85
  17. package/Spot.cs.meta +11 -11
  18. package/SpotColliderHandler.cs +67 -67
  19. package/SpotColliderHandler.cs.meta +11 -11
  20. package/SpotSelectionBuilder.cs +88 -88
  21. package/SpotSelectionBuilder.cs.meta +11 -11
  22. package/SpotSelectionBuilderEditor.cs +134 -134
  23. package/SpotSelectionBuilderEditor.cs.meta +11 -11
  24. package/SpotSelectionComponent.cs +26 -26
  25. package/SpotSelectionComponent.cs.meta +11 -11
  26. package/SpotSelectionDisplayer.cs +28 -28
  27. package/SpotSelectionDisplayer.cs.meta +11 -11
  28. package/SpotSelectionEditorComponentBase.cs +24 -24
  29. package/SpotSelectionEditorComponentBase.cs.meta +11 -11
  30. package/SpotSelectionImageDisplayer.cs +29 -29
  31. package/SpotSelectionImageDisplayer.cs.meta +11 -11
  32. package/SpotSelectionManager.cs +308 -308
  33. package/SpotSelectionManager.cs.meta +11 -11
  34. package/SpotSelectionManagerBase.cs +83 -83
  35. package/SpotSelectionManagerBase.cs.meta +1 -1
  36. package/SpotSelectionReticle.cs +45 -45
  37. package/SpotSelectionReticle.cs.meta +11 -11
  38. package/SpotSelectionToolEditor.cs +171 -171
  39. package/SpotSelectionToolEditor.cs.meta +11 -11
  40. package/SpotsEditor.cs +190 -190
  41. package/SpotsEditor.cs.meta +11 -11
  42. package/package.json +43 -38
  43. package/package.json.meta +7 -7
  44. package/Samples.meta +0 -8
@@ -1,84 +1,84 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using UnityEngine;
3
- using UnityEngine.InputSystem;
4
- using UnityEngine.UI;
5
- using static UnityEngine.InputSystem.InputAction;
6
-
7
- namespace DREditor.Minigames.SS
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- public abstract class SpotSelectionManagerBase : MinigameManagerBase
13
- {
14
- /// <summary>
15
- ///
16
- /// </summary>
17
- [Header("")]
18
- [Divider]
19
- [Tooltip("")]
20
- [SerializeField] protected InputActionReference submit = null;
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Tooltip("")]
26
- [SerializeField] protected Button yesButton = null;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- [Tooltip("")]
32
- [SerializeField] protected Button noButton = null;
33
-
34
-
35
- /// <inheritdoc/>
36
- protected override void OnMinigameEnable()
37
- {
38
- base.OnMinigameEnable();
39
-
40
- yesButton.onClick.AddListener(ConfirmSelection);
41
-
42
- noButton.onClick.AddListener(LeaveConfirmUI);
43
- }
44
-
45
- /// <inheritdoc/>
46
- protected override void OnMinigameDisable()
47
- {
48
- base.OnMinigameDisable();
49
-
50
- yesButton.onClick.RemoveListener(ConfirmSelection);
51
-
52
- noButton.onClick.RemoveListener(LeaveConfirmUI);
53
- }
54
-
55
- /// <summary>
56
- ///
57
- /// </summary>
58
- /// <remarks></remarks>
59
- public abstract void ConfirmSelection();
60
-
61
- /// <summary>
62
- ///
63
- /// </summary>
64
- /// <remarks></remarks>
65
- public abstract void LeaveConfirmUI();
66
-
67
-
68
- /// <summary>
69
- ///
70
- /// </summary>
71
- protected virtual void EnableSubmit() => submit.action.started += SubmitSpot;
72
-
73
- /// <summary>
74
- ///
75
- /// </summary>
76
- protected virtual void DisableSubmit() => submit.action.started -= SubmitSpot;
77
-
78
- /// <summary>
79
- ///
80
- /// </summary>
81
- /// <param name="ctx"></param>
82
- protected abstract void SubmitSpot(CallbackContext ctx);
83
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using UnityEngine;
3
+ using UnityEngine.InputSystem;
4
+ using UnityEngine.UI;
5
+ using static UnityEngine.InputSystem.InputAction;
6
+
7
+ namespace DREditor.Minigames.SS
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ public abstract class SpotSelectionManagerBase : MinigameManagerBase
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ [Header("")]
18
+ [Divider]
19
+ [Tooltip("")]
20
+ [SerializeField] protected InputActionReference submit = null;
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected Button yesButton = null;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected Button noButton = null;
33
+
34
+
35
+ /// <inheritdoc/>
36
+ protected override void OnMinigameEnable()
37
+ {
38
+ base.OnMinigameEnable();
39
+
40
+ yesButton.onClick.AddListener(ConfirmSelection);
41
+
42
+ noButton.onClick.AddListener(LeaveConfirmUI);
43
+ }
44
+
45
+ /// <inheritdoc/>
46
+ protected override void OnMinigameDisable()
47
+ {
48
+ base.OnMinigameDisable();
49
+
50
+ yesButton.onClick.RemoveListener(ConfirmSelection);
51
+
52
+ noButton.onClick.RemoveListener(LeaveConfirmUI);
53
+ }
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ /// <remarks></remarks>
59
+ public abstract void ConfirmSelection();
60
+
61
+ /// <summary>
62
+ ///
63
+ /// </summary>
64
+ /// <remarks></remarks>
65
+ public abstract void LeaveConfirmUI();
66
+
67
+
68
+ /// <summary>
69
+ ///
70
+ /// </summary>
71
+ protected virtual void EnableSubmit() => submit.action.started += SubmitSpot;
72
+
73
+ /// <summary>
74
+ ///
75
+ /// </summary>
76
+ protected virtual void DisableSubmit() => submit.action.started -= SubmitSpot;
77
+
78
+ /// <summary>
79
+ ///
80
+ /// </summary>
81
+ /// <param name="ctx"></param>
82
+ protected abstract void SubmitSpot(CallbackContext ctx);
83
+ }
84
84
  }
@@ -1,2 +1,2 @@
1
- fileFormatVersion: 2
1
+ fileFormatVersion: 2
2
2
  guid: d6c6234f6dccc6f4eb7346094e9bb6a3
@@ -1,46 +1,46 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.UIHandling.Reticles;
3
- using UnityEngine;
4
-
5
- namespace DREditor.Minigames.SS
6
- {
7
- /// <summary>
8
- ///
9
- /// </summary>
10
- [ClassHeader(nameof(HoverReticle) + ", " + nameof(Reticle) +
11
- "\n\n")]
12
- public class SpotSelectionReticle : HoverReticle
13
- {
14
- /// <inheritdoc/>
15
- protected override void Start()
16
- {
17
- base.Start();
18
-
19
- Cursor.lockState = CursorLockMode.Confined;
20
- }
21
-
22
- protected virtual void OnTriggerEnter2D(Collider2D collision)
23
- {
24
- if (locked || hoveredObject != null)
25
- return;
26
-
27
- HoverObject(collision.transform, collision);
28
- }
29
-
30
- protected virtual void OnTriggerStay2D(Collider2D collision)
31
- {
32
- if (locked || hoveredObject != null)
33
- return;
34
-
35
- HoverObject(collision.transform, collision);
36
- }
37
-
38
- protected virtual void OnTriggerExit2D(Collider2D collision)
39
- {
40
- if (locked || collision != GetHoveredObject<Collider2D>())
41
- return;
42
-
43
- StopHoveringObject();
44
- }
45
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.UIHandling.Reticles;
3
+ using UnityEngine;
4
+
5
+ namespace DREditor.Minigames.SS
6
+ {
7
+ /// <summary>
8
+ ///
9
+ /// </summary>
10
+ [ClassHeader(nameof(HoverReticle) + ", " + nameof(Reticle) +
11
+ "\n\n")]
12
+ public class SpotSelectionReticle : HoverReticle
13
+ {
14
+ /// <inheritdoc/>
15
+ protected override void Start()
16
+ {
17
+ base.Start();
18
+
19
+ Cursor.lockState = CursorLockMode.Confined;
20
+ }
21
+
22
+ protected virtual void OnTriggerEnter2D(Collider2D collision)
23
+ {
24
+ if (locked || hoveredObject != null)
25
+ return;
26
+
27
+ HoverObject(collision.transform, collision);
28
+ }
29
+
30
+ protected virtual void OnTriggerStay2D(Collider2D collision)
31
+ {
32
+ if (locked || hoveredObject != null)
33
+ return;
34
+
35
+ HoverObject(collision.transform, collision);
36
+ }
37
+
38
+ protected virtual void OnTriggerExit2D(Collider2D collision)
39
+ {
40
+ if (locked || collision != GetHoveredObject<Collider2D>())
41
+ return;
42
+
43
+ StopHoveringObject();
44
+ }
45
+ }
46
46
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 1f9b3227d230b9c449db78be0ff26687
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: 1f9b3227d230b9c449db78be0ff26687
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,172 +1,172 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if UNITY_EDITOR
3
- using UnityEditor;
4
- using UnityEngine;
5
- using UnityEngine.UI;
6
-
7
- namespace DREditor.Minigames.SS
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [System.Serializable]
13
- public class SpotSelectionToolEditor : SpotSelectionEditorComponentBase
14
- {
15
- /// <summary>
16
- ///
17
- /// </summary>
18
- protected Canvas canvas;
19
-
20
- /// <summary>
21
- ///
22
- /// </summary>
23
- protected Image cg;
24
-
25
-
26
- public SpotSelectionToolEditor(SpotSelectionBuilder builder) : base(builder) { }
27
-
28
-
29
- /// <inheritdoc/>
30
- public override void Display()
31
- {
32
- GUILayout.Label("Testing Tools", GUILayout.Width(50));
33
-
34
- DisplayCanvasTool();
35
-
36
- DisplayImageTool();
37
-
38
- GUILayout.Space(30);
39
- }
40
-
41
- /// <summary>
42
- ///
43
- /// </summary>
44
- protected virtual void DisplayCanvasTool()
45
- {
46
- using (new EditorGUILayout.HorizontalScope())
47
- {
48
- GUILayout.Label("Test Canvas: ", GUILayout.Width(90));
49
-
50
- builder.SetTestCanvas(EditorGUILayout.TextField(builder.testCanvas, GUILayout.Width(125)));
51
-
52
- DisplayExpotSpotsButton();
53
-
54
- DisplayClearButton();
55
- }
56
- }
57
-
58
- /// <summary>
59
- ///
60
- /// </summary>
61
- protected virtual void DisplayExpotSpotsButton()
62
- {
63
- if (GUILayout.Button("Export Spots", GUILayout.Width(100)))
64
- for (int i = 0; i < builder.spots.Count; i++)
65
- ExportSpot(builder.spots[i]);
66
- }
67
-
68
- /// <summary>
69
- ///
70
- /// </summary>
71
- /// <param name="spot"></param>
72
- /// <remarks>
73
- ///
74
- /// </remarks>
75
- protected virtual void ExportSpot(Spot spot)
76
- {
77
- if (canvas == null && GameObject.Find(builder.testCanvas).TryGetComponent<Canvas>(out canvas))
78
- {
79
- GameObject spotGameObject = new(spot.spotName);
80
-
81
- spotGameObject.transform.parent = canvas.transform;
82
-
83
- BoxCollider2D collider = spotGameObject.AddComponent<BoxCollider2D>();
84
-
85
- collider.size = spot.size;
86
-
87
- collider.offset = spot.center;
88
-
89
- spotGameObject.transform.position = spot.position;
90
-
91
- spotGameObject.transform.eulerAngles = spot.rotation;
92
- }
93
- else
94
- UnityEngine.Debug.LogWarning("The Canvas by that name was not found in the scene!");
95
- }
96
-
97
-
98
- /// <summary>
99
- ///
100
- /// </summary>
101
- protected virtual void DisplayClearButton()
102
- {
103
- if (GUILayout.Button("Clear Canvas Spots", GUILayout.Width(150)) &&
104
- EditorUtility.DisplayDialog(
105
- "Clear Canvas Spots",
106
- "Are you sure you want to Clear All Canvas Spots?",
107
- "Yes", "No"))
108
- ClearDebugUI();
109
- }
110
-
111
- /// <summary>
112
- ///
113
- /// </summary>
114
- protected virtual void ClearDebugUI()
115
- {
116
- if (canvas == null && GameObject.Find(builder.testCanvas).TryGetComponent<Canvas>(out canvas))
117
- {
118
- ClearSpotColliders();
119
-
120
- ClearDisplayImage();
121
- }
122
- else
123
- UnityEngine.Debug.LogWarning("The Canvas by that name was not found in the scene!");
124
- }
125
-
126
- /// <summary>
127
- ///
128
- /// </summary>
129
- protected virtual void ClearSpotColliders()
130
- {
131
- BoxCollider2D[] boxes = canvas.GetComponentsInChildren<BoxCollider2D>();
132
-
133
- for (int i = 0; i < boxes.Length; i++)
134
- if (boxes[i].GetComponent<Rigidbody2D>() != null)
135
- continue;
136
- else
137
- MonoBehaviour.DestroyImmediate(boxes[i].gameObject);
138
- }
139
-
140
- /// <summary>
141
- ///
142
- /// </summary>
143
- protected virtual void ClearDisplayImage()
144
- {
145
- Image image = GameObject.Find(builder.testCG).GetComponent<Image>();
146
-
147
- image.sprite = null;
148
- }
149
-
150
-
151
- /// <summary>
152
- ///
153
- /// </summary>
154
- protected virtual void DisplayImageTool()
155
- {
156
- using (new EditorGUILayout.HorizontalScope())
157
- {
158
- GUILayout.Label("Test CG: ", GUILayout.Width(90));
159
-
160
- builder.SetTestCG(EditorGUILayout.TextField(builder.testCG, GUILayout.Width(125)));
161
-
162
- if (GUILayout.Button("Set CG", GUILayout.Width(100)))
163
- {
164
- cg = GameObject.Find(builder.testCG).GetComponent<Image>();
165
-
166
- cg.sprite = builder.sprite;
167
- }
168
- }
169
- }
170
- }
171
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if UNITY_EDITOR
3
+ using UnityEditor;
4
+ using UnityEngine;
5
+ using UnityEngine.UI;
6
+
7
+ namespace DREditor.Minigames.SS
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [System.Serializable]
13
+ public class SpotSelectionToolEditor : SpotSelectionEditorComponentBase
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ protected Canvas canvas;
19
+
20
+ /// <summary>
21
+ ///
22
+ /// </summary>
23
+ protected Image cg;
24
+
25
+
26
+ public SpotSelectionToolEditor(SpotSelectionBuilder builder) : base(builder) { }
27
+
28
+
29
+ /// <inheritdoc/>
30
+ public override void Display()
31
+ {
32
+ GUILayout.Label("Testing Tools", GUILayout.Width(50));
33
+
34
+ DisplayCanvasTool();
35
+
36
+ DisplayImageTool();
37
+
38
+ GUILayout.Space(30);
39
+ }
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ protected virtual void DisplayCanvasTool()
45
+ {
46
+ using (new EditorGUILayout.HorizontalScope())
47
+ {
48
+ GUILayout.Label("Test Canvas: ", GUILayout.Width(90));
49
+
50
+ builder.SetTestCanvas(EditorGUILayout.TextField(builder.testCanvas, GUILayout.Width(125)));
51
+
52
+ DisplayExpotSpotsButton();
53
+
54
+ DisplayClearButton();
55
+ }
56
+ }
57
+
58
+ /// <summary>
59
+ ///
60
+ /// </summary>
61
+ protected virtual void DisplayExpotSpotsButton()
62
+ {
63
+ if (GUILayout.Button("Export Spots", GUILayout.Width(100)))
64
+ for (int i = 0; i < builder.spots.Count; i++)
65
+ ExportSpot(builder.spots[i]);
66
+ }
67
+
68
+ /// <summary>
69
+ ///
70
+ /// </summary>
71
+ /// <param name="spot"></param>
72
+ /// <remarks>
73
+ ///
74
+ /// </remarks>
75
+ protected virtual void ExportSpot(Spot spot)
76
+ {
77
+ if (canvas == null && GameObject.Find(builder.testCanvas).TryGetComponent<Canvas>(out canvas))
78
+ {
79
+ GameObject spotGameObject = new(spot.spotName);
80
+
81
+ spotGameObject.transform.parent = canvas.transform;
82
+
83
+ BoxCollider2D collider = spotGameObject.AddComponent<BoxCollider2D>();
84
+
85
+ collider.size = spot.size;
86
+
87
+ collider.offset = spot.center;
88
+
89
+ spotGameObject.transform.position = spot.position;
90
+
91
+ spotGameObject.transform.eulerAngles = spot.rotation;
92
+ }
93
+ else
94
+ UnityEngine.Debug.LogWarning("The Canvas by that name was not found in the scene!");
95
+ }
96
+
97
+
98
+ /// <summary>
99
+ ///
100
+ /// </summary>
101
+ protected virtual void DisplayClearButton()
102
+ {
103
+ if (GUILayout.Button("Clear Canvas Spots", GUILayout.Width(150)) &&
104
+ EditorUtility.DisplayDialog(
105
+ "Clear Canvas Spots",
106
+ "Are you sure you want to Clear All Canvas Spots?",
107
+ "Yes", "No"))
108
+ ClearDebugUI();
109
+ }
110
+
111
+ /// <summary>
112
+ ///
113
+ /// </summary>
114
+ protected virtual void ClearDebugUI()
115
+ {
116
+ if (canvas == null && GameObject.Find(builder.testCanvas).TryGetComponent<Canvas>(out canvas))
117
+ {
118
+ ClearSpotColliders();
119
+
120
+ ClearDisplayImage();
121
+ }
122
+ else
123
+ UnityEngine.Debug.LogWarning("The Canvas by that name was not found in the scene!");
124
+ }
125
+
126
+ /// <summary>
127
+ ///
128
+ /// </summary>
129
+ protected virtual void ClearSpotColliders()
130
+ {
131
+ BoxCollider2D[] boxes = canvas.GetComponentsInChildren<BoxCollider2D>();
132
+
133
+ for (int i = 0; i < boxes.Length; i++)
134
+ if (boxes[i].GetComponent<Rigidbody2D>() != null)
135
+ continue;
136
+ else
137
+ MonoBehaviour.DestroyImmediate(boxes[i].gameObject);
138
+ }
139
+
140
+ /// <summary>
141
+ ///
142
+ /// </summary>
143
+ protected virtual void ClearDisplayImage()
144
+ {
145
+ Image image = GameObject.Find(builder.testCG).GetComponent<Image>();
146
+
147
+ image.sprite = null;
148
+ }
149
+
150
+
151
+ /// <summary>
152
+ ///
153
+ /// </summary>
154
+ protected virtual void DisplayImageTool()
155
+ {
156
+ using (new EditorGUILayout.HorizontalScope())
157
+ {
158
+ GUILayout.Label("Test CG: ", GUILayout.Width(90));
159
+
160
+ builder.SetTestCG(EditorGUILayout.TextField(builder.testCG, GUILayout.Width(125)));
161
+
162
+ if (GUILayout.Button("Set CG", GUILayout.Width(100)))
163
+ {
164
+ cg = GameObject.Find(builder.testCG).GetComponent<Image>();
165
+
166
+ cg.sprite = builder.sprite;
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
172
  #endif
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 051e857cc8ba26c4b8fb57fecf6c7ef4
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: 051e857cc8ba26c4b8fb57fecf6c7ef4
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: