net.dreditor.purchasing 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.
Files changed (52) hide show
  1. package/.attestation.p7m +0 -0
  2. package/BufferedSelectedUICacher.cs +73 -73
  3. package/BufferedSelectedUICacher.cs.meta +1 -1
  4. package/DREditor.Purchasing.asmdef +18 -18
  5. package/DREditor.Purchasing.asmdef.meta +7 -7
  6. package/DigitArrow.cs +143 -143
  7. package/DigitArrow.cs.meta +11 -11
  8. package/DisplayCurrencyDigits.cs +122 -122
  9. package/DisplayCurrencyDigits.cs.meta +1 -1
  10. package/DisplayDigit.cs +83 -83
  11. package/DisplayDigit.cs.meta +1 -1
  12. package/DisplayDigits.cs +147 -147
  13. package/DisplayDigits.cs.meta +1 -1
  14. package/EnableInputOnPurchaseComplete.cs +11 -11
  15. package/EnableInputOnPurchaseComplete.cs.meta +1 -1
  16. package/FollowSelectedObject.cs +19 -19
  17. package/FollowSelectedObject.cs.meta +1 -1
  18. package/IDigitPlace.cs +27 -27
  19. package/IDigitPlace.cs.meta +1 -1
  20. package/IntPurchaseInputHandler.cs +77 -77
  21. package/IntPurchaseInputHandler.cs.meta +1 -1
  22. package/PurchaseInputHandlerBase.cs +132 -132
  23. package/PurchaseInputHandlerBase.cs.meta +1 -1
  24. package/{Samples → Samples~}/Buffered_Selected_UI_Cacher.prefab +48 -48
  25. package/{Samples → Samples~}/Buffered_Selected_UI_Cacher.prefab.meta +7 -7
  26. package/{Samples → Samples~}/Enable_Input_On_Purchase_Complete.prefab +55 -55
  27. package/{Samples → Samples~}/Enable_Input_On_Purchase_Complete.prefab.meta +7 -7
  28. package/{Samples → Samples~}/FTE_Currency_Arrows_ETemplate.prefab +248 -248
  29. package/{Samples → Samples~}/FTE_Currency_Arrows_ETemplate.prefab.meta +7 -7
  30. package/{Samples → Samples~}/FTE_Currency_Canvas_ETemplate.prefab +736 -736
  31. package/{Samples → Samples~}/FTE_Currency_Canvas_ETemplate.prefab.meta +7 -7
  32. package/{Samples → Samples~}/FTE_Input_Amount_Display_ETemplate.prefab +646 -646
  33. package/{Samples → Samples~}/FTE_Input_Amount_Display_ETemplate.prefab.meta +7 -7
  34. package/{Samples → Samples~}/FTE_Owned_Amount_Display_ETemplate.prefab +263 -263
  35. package/{Samples → Samples~}/FTE_Owned_Amount_Display_ETemplate.prefab.meta +7 -7
  36. package/{Samples → Samples~}/FTE_Purchase_Complete_Handler.prefab +57 -57
  37. package/{Samples → Samples~}/FTE_Purchase_Complete_Handler.prefab.meta +7 -7
  38. package/{Samples → Samples~}/Hundreds_Digit.prefab +201 -201
  39. package/{Samples → Samples~}/Hundreds_Digit.prefab.meta +7 -7
  40. package/{Samples → Samples~}/On_Cant_Purchase_Listener.prefab +52 -52
  41. package/{Samples → Samples~}/On_Cant_Purchase_Listener.prefab.meta +7 -7
  42. package/{Samples → Samples~}/On_Purchase_Listener.prefab +52 -52
  43. package/{Samples → Samples~}/On_Purchase_Listener.prefab.meta +7 -7
  44. package/{Samples → Samples~}/Ones_Digit.prefab +220 -220
  45. package/{Samples → Samples~}/Ones_Digit.prefab.meta +7 -7
  46. package/{Samples → Samples~}/Tens_Digit.prefab +201 -201
  47. package/{Samples → Samples~}/Tens_Digit.prefab.meta +7 -7
  48. package/SelectedUICacher.cs +75 -75
  49. package/SelectedUICacher.cs.meta +1 -1
  50. package/package.json +42 -37
  51. package/package.json.meta +7 -7
  52. package/Samples.meta +0 -8
Binary file
@@ -1,74 +1,74 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using System;
3
- using System.Collections;
4
- using UnityEngine;
5
-
6
- namespace DREditor.Purchasing
7
- {
8
- /// <summary>
9
- ///
10
- /// </summary>
11
- public class BufferedSelectedUICacher : SelectedUICacher
12
- {
13
- /// <summary>
14
- ///
15
- /// </summary>
16
- [Header("")]
17
- [Space]
18
- [Tooltip("")]
19
- [SerializeField] protected float selectBufferDuration = 0.5f;
20
-
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- protected bool waitingThroughBuffer = false;
26
-
27
-
28
- /// <inheritdoc/>
29
- public override void CacheObject() => CacheObjectResponse()?.Invoke();
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- /// <returns></returns>
35
- protected virtual Action CacheObjectResponse() => waitingThroughBuffer ? ResetBuffer : base.CacheObject;
36
-
37
- /// <summary>
38
- ///
39
- /// </summary>
40
- protected virtual void ResetBuffer()
41
- {
42
- StopAllCoroutines();
43
-
44
- SetWaitingThroughBuffer(false);
45
- }
46
-
47
-
48
- /// <inheritdoc/>
49
- protected override bool ShouldSelectCachedObject() => !waitingThroughBuffer && base.ShouldSelectCachedObject();
50
-
51
- /// <inheritdoc/>
52
- protected override void SelectCachedObject() => StartCoroutine(BufferSelection());
53
-
54
- /// <summary>
55
- ///
56
- /// </summary>
57
- protected virtual IEnumerator BufferSelection()
58
- {
59
- SetWaitingThroughBuffer(true);
60
-
61
- yield return new WaitForSeconds(selectBufferDuration);
62
-
63
- base.SelectCachedObject();
64
-
65
- ResetBuffer();
66
- }
67
-
68
- /// <summary>
69
- ///
70
- /// </summary>
71
- /// <param name="waitingThroughBuffer"></param>
72
- protected virtual void SetWaitingThroughBuffer(bool waitingThroughBuffer) => this.waitingThroughBuffer = waitingThroughBuffer;
73
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System;
3
+ using System.Collections;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.Purchasing
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ public class BufferedSelectedUICacher : SelectedUICacher
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [Header("")]
17
+ [Space]
18
+ [Tooltip("")]
19
+ [SerializeField] protected float selectBufferDuration = 0.5f;
20
+
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ protected bool waitingThroughBuffer = false;
26
+
27
+
28
+ /// <inheritdoc/>
29
+ public override void CacheObject() => CacheObjectResponse()?.Invoke();
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ /// <returns></returns>
35
+ protected virtual Action CacheObjectResponse() => waitingThroughBuffer ? ResetBuffer : base.CacheObject;
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ protected virtual void ResetBuffer()
41
+ {
42
+ StopAllCoroutines();
43
+
44
+ SetWaitingThroughBuffer(false);
45
+ }
46
+
47
+
48
+ /// <inheritdoc/>
49
+ protected override bool ShouldSelectCachedObject() => !waitingThroughBuffer && base.ShouldSelectCachedObject();
50
+
51
+ /// <inheritdoc/>
52
+ protected override void SelectCachedObject() => StartCoroutine(BufferSelection());
53
+
54
+ /// <summary>
55
+ ///
56
+ /// </summary>
57
+ protected virtual IEnumerator BufferSelection()
58
+ {
59
+ SetWaitingThroughBuffer(true);
60
+
61
+ yield return new WaitForSeconds(selectBufferDuration);
62
+
63
+ base.SelectCachedObject();
64
+
65
+ ResetBuffer();
66
+ }
67
+
68
+ /// <summary>
69
+ ///
70
+ /// </summary>
71
+ /// <param name="waitingThroughBuffer"></param>
72
+ protected virtual void SetWaitingThroughBuffer(bool waitingThroughBuffer) => this.waitingThroughBuffer = waitingThroughBuffer;
73
+ }
74
74
  }
@@ -1,2 +1,2 @@
1
- fileFormatVersion: 2
1
+ fileFormatVersion: 2
2
2
  guid: 7b5aff0506d2dd2499b7fb6beb7f5895
@@ -1,19 +1,19 @@
1
- {
2
- "name": "DREditor.Purchasing",
3
- "rootNamespace": "",
4
- "references": [
5
- "Unity.InputSystem",
6
- "Unity.TextMeshPro",
7
- "DREditor",
8
- "DREditor.EventObjectServices"
9
- ],
10
- "includePlatforms": [],
11
- "excludePlatforms": [],
12
- "allowUnsafeCode": false,
13
- "overrideReferences": false,
14
- "precompiledReferences": [],
15
- "autoReferenced": true,
16
- "defineConstraints": [],
17
- "versionDefines": [],
18
- "noEngineReferences": false
1
+ {
2
+ "name": "DREditor.Purchasing",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "Unity.InputSystem",
6
+ "Unity.TextMeshPro",
7
+ "DREditor",
8
+ "DREditor.EventObjectServices"
9
+ ],
10
+ "includePlatforms": [],
11
+ "excludePlatforms": [],
12
+ "allowUnsafeCode": false,
13
+ "overrideReferences": false,
14
+ "precompiledReferences": [],
15
+ "autoReferenced": true,
16
+ "defineConstraints": [],
17
+ "versionDefines": [],
18
+ "noEngineReferences": false
19
19
  }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: a7cde9b5f585acb489343da39e32a0f4
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: a7cde9b5f585acb489343da39e32a0f4
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/DigitArrow.cs CHANGED
@@ -1,144 +1,144 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if DOTWEEN
3
- using DG.Tweening;
4
- #endif
5
- using UnityEngine;
6
- using UnityEngine.UI;
7
-
8
- namespace DREditor.Purchasing
9
- {
10
- /// <summary>
11
- ///
12
- /// </summary>
13
- [RequireComponent(typeof(Image))]
14
- public class DigitArrow : MonoBehaviour
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- [Header("")]
20
- [Space]
21
- [Header("")]
22
- [Space]
23
- [Tooltip("")]
24
- [SerializeField] protected bool debugReset = false;
25
-
26
- /// <summary>
27
- ///
28
- /// </summary>
29
- [Tooltip("")]
30
- [SerializeField] protected Vector3 resetPosition;
31
-
32
-
33
- /// <summary>
34
- ///
35
- /// </summary>
36
- [Header("")]
37
- [Space]
38
- [Tooltip("")]
39
- [SerializeField] protected Vector3 direction = Vector3.up;
40
-
41
- /// <summary>
42
- ///
43
- /// </summary>
44
- [Tooltip("")]
45
- [SerializeField] protected float duration = 0.2f;
46
-
47
- /// <summary>
48
- ///
49
- /// </summary>
50
- [Tooltip("")]
51
- [SerializeField] protected float directionMultiplier = 7;
52
-
53
- /// <summary>
54
- ///
55
- /// </summary>
56
- [Tooltip("")]
57
- [SerializeField] protected bool ignoreTimeScale = false;
58
- #if DOTWEEN
59
- /// <summary>
60
- ///
61
- /// </summary>
62
- [Tooltip("")]
63
- [SerializeField] protected Ease easeCurve = Ease.Linear;
64
- #endif
65
- /// <summary>
66
- ///
67
- /// </summary>
68
- [Tooltip("")]
69
- [SerializeField] protected int loops = 0;
70
- #if DOTWEEN
71
- /// <summary>
72
- ///
73
- /// </summary>
74
- [Tooltip("")]
75
- [SerializeField] protected LoopType loopType = LoopType.Yoyo;
76
- #endif
77
- /// <summary>
78
- ///
79
- /// </summary>
80
- [Tooltip("")]
81
- [SerializeField] protected float delay = 0f;
82
-
83
-
84
- protected virtual void Awake() => Initialize();
85
-
86
- protected virtual void OnValidate() => Initialize();
87
-
88
- /// <summary>
89
- ///
90
- /// </summary>
91
- protected virtual void Initialize() => resetPosition = transform.localPosition;
92
-
93
-
94
- protected virtual void Start() => StartAnimatingArrow();
95
-
96
- protected virtual void Update()
97
- {
98
- if (debugReset)
99
- StartAnimatingArrow();
100
- }
101
-
102
- /// <summary>
103
- ///
104
- /// </summary>
105
- protected virtual void StartAnimatingArrow()
106
- {
107
- ResetArrow();
108
-
109
- AnimateArrow();
110
- }
111
-
112
- /// <summary>
113
- ///
114
- /// </summary>
115
- protected virtual void ResetArrow()
116
- {
117
- debugReset = false;
118
- #if DOTWEEN
119
- transform.DOKill();
120
- #endif
121
- transform.localPosition = resetPosition;
122
- }
123
-
124
- /// <summary>
125
- ///
126
- /// </summary>
127
- protected virtual void AnimateArrow()
128
- {
129
- #if DOTWEEN
130
- transform.DOLocalMove(GetEndPosition(), duration)
131
- .SetUpdate(ignoreTimeScale)
132
- .SetEase(easeCurve)
133
- .SetLoops(loops, loopType)
134
- .SetDelay(delay);
135
- #endif
136
- }
137
-
138
- /// <summary>
139
- ///
140
- /// </summary>
141
- /// <returns></returns>
142
- protected virtual Vector3 GetEndPosition() => resetPosition + (direction * directionMultiplier);
143
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if DOTWEEN
3
+ using DG.Tweening;
4
+ #endif
5
+ using UnityEngine;
6
+ using UnityEngine.UI;
7
+
8
+ namespace DREditor.Purchasing
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ [RequireComponent(typeof(Image))]
14
+ public class DigitArrow : MonoBehaviour
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ [Header("")]
20
+ [Space]
21
+ [Header("")]
22
+ [Space]
23
+ [Tooltip("")]
24
+ [SerializeField] protected bool debugReset = false;
25
+
26
+ /// <summary>
27
+ ///
28
+ /// </summary>
29
+ [Tooltip("")]
30
+ [SerializeField] protected Vector3 resetPosition;
31
+
32
+
33
+ /// <summary>
34
+ ///
35
+ /// </summary>
36
+ [Header("")]
37
+ [Space]
38
+ [Tooltip("")]
39
+ [SerializeField] protected Vector3 direction = Vector3.up;
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ [Tooltip("")]
45
+ [SerializeField] protected float duration = 0.2f;
46
+
47
+ /// <summary>
48
+ ///
49
+ /// </summary>
50
+ [Tooltip("")]
51
+ [SerializeField] protected float directionMultiplier = 7;
52
+
53
+ /// <summary>
54
+ ///
55
+ /// </summary>
56
+ [Tooltip("")]
57
+ [SerializeField] protected bool ignoreTimeScale = false;
58
+ #if DOTWEEN
59
+ /// <summary>
60
+ ///
61
+ /// </summary>
62
+ [Tooltip("")]
63
+ [SerializeField] protected Ease easeCurve = Ease.Linear;
64
+ #endif
65
+ /// <summary>
66
+ ///
67
+ /// </summary>
68
+ [Tooltip("")]
69
+ [SerializeField] protected int loops = 0;
70
+ #if DOTWEEN
71
+ /// <summary>
72
+ ///
73
+ /// </summary>
74
+ [Tooltip("")]
75
+ [SerializeField] protected LoopType loopType = LoopType.Yoyo;
76
+ #endif
77
+ /// <summary>
78
+ ///
79
+ /// </summary>
80
+ [Tooltip("")]
81
+ [SerializeField] protected float delay = 0f;
82
+
83
+
84
+ protected virtual void Awake() => Initialize();
85
+
86
+ protected virtual void OnValidate() => Initialize();
87
+
88
+ /// <summary>
89
+ ///
90
+ /// </summary>
91
+ protected virtual void Initialize() => resetPosition = transform.localPosition;
92
+
93
+
94
+ protected virtual void Start() => StartAnimatingArrow();
95
+
96
+ protected virtual void Update()
97
+ {
98
+ if (debugReset)
99
+ StartAnimatingArrow();
100
+ }
101
+
102
+ /// <summary>
103
+ ///
104
+ /// </summary>
105
+ protected virtual void StartAnimatingArrow()
106
+ {
107
+ ResetArrow();
108
+
109
+ AnimateArrow();
110
+ }
111
+
112
+ /// <summary>
113
+ ///
114
+ /// </summary>
115
+ protected virtual void ResetArrow()
116
+ {
117
+ debugReset = false;
118
+ #if DOTWEEN
119
+ transform.DOKill();
120
+ #endif
121
+ transform.localPosition = resetPosition;
122
+ }
123
+
124
+ /// <summary>
125
+ ///
126
+ /// </summary>
127
+ protected virtual void AnimateArrow()
128
+ {
129
+ #if DOTWEEN
130
+ transform.DOLocalMove(GetEndPosition(), duration)
131
+ .SetUpdate(ignoreTimeScale)
132
+ .SetEase(easeCurve)
133
+ .SetLoops(loops, loopType)
134
+ .SetDelay(delay);
135
+ #endif
136
+ }
137
+
138
+ /// <summary>
139
+ ///
140
+ /// </summary>
141
+ /// <returns></returns>
142
+ protected virtual Vector3 GetEndPosition() => resetPosition + (direction * directionMultiplier);
143
+ }
144
144
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: b997a92fc240d964287bebb61d1dcaad
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: b997a92fc240d964287bebb61d1dcaad
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: