net.dreditor.ui.menus 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.
@@ -1,109 +1,109 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using UnityEngine;
3
- using UnityEngine.Serialization;
4
- using UnityEngine.UI;
5
-
6
- namespace DREditor.UI.Menus
7
- {
8
- /// <summary>
9
- ///
10
- /// </summary>
11
- /// <remarks></remarks>
12
- [ClassHeader(nameof(SelectHandler) +
13
- "\n\n")]
14
- [DefaultExecutionOrder(-1)]
15
- public class ImageSelectHandler : SelectHandler
16
- {
17
- /// <summary>
18
- ///
19
- /// </summary>
20
- [Tooltip("")]
21
- [SerializeField] protected Image image = null;
22
-
23
- /// <summary>
24
- ///
25
- /// </summary>
26
- [Tooltip("")]
27
- [FormerlySerializedAs("selectImage")]
28
- [SerializeField] protected Sprite selectedSprite = null;
29
-
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- [Header("")]
35
- [Divider]
36
- [Tooltip("")]
37
- [SerializeField] protected bool colorImage = false;
38
-
39
- /// <summary>
40
- ///
41
- /// </summary>
42
- [Tooltip("")]
43
- [FormerlySerializedAs("initialText")]
44
- [SerializeField] protected Color initialColor = Color.black;
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- [Tooltip("")]
50
- [FormerlySerializedAs("selectText")]
51
- [SerializeField] protected Color selectedColor = Color.white;
52
-
53
- /// <summary>
54
- ///
55
- /// </summary>
56
- [Divider]
57
-
58
- [Tooltip("")]
59
- [SerializeField] protected bool enableMode = false;
60
-
61
-
62
- /// <summary>
63
- ///
64
- /// </summary>
65
- protected Sprite initialSprite = null;
66
-
67
-
68
- /// <summary>
69
- ///
70
- /// </summary>
71
- protected virtual void Awake()
72
- {
73
- if (!image)
74
- image = GetComponent<Image>();
75
-
76
- if (!enableMode && image)
77
- initialSprite = image.sprite;
78
-
79
- if (colorImage)
80
- initialColor = image.color;
81
- }
82
-
83
- /// <inheritdoc/>
84
- public override void Select()
85
- {
86
- if (enableMode && !image.enabled)
87
- image.enabled = true;
88
-
89
- if (!enableMode && image && selectedSprite)
90
- image.sprite = selectedSprite;
91
-
92
- if (colorImage)
93
- image.color = selectedColor;
94
- }
95
-
96
- /// <inheritdoc/>
97
- public override void Deselect()
98
- {
99
- if (enableMode && image.enabled)
100
- image.enabled = false;
101
-
102
- if (!enableMode && image)
103
- image.sprite = initialSprite;
104
-
105
- if (colorImage)
106
- image.color = initialColor;
107
- }
108
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using UnityEngine;
3
+ using UnityEngine.Serialization;
4
+ using UnityEngine.UI;
5
+
6
+ namespace DREditor.UI.Menus
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ /// <remarks></remarks>
12
+ [ClassHeader(nameof(SelectHandler) +
13
+ "\n\n")]
14
+ [DefaultExecutionOrder(-1)]
15
+ public class ImageSelectHandler : SelectHandler
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ [Tooltip("")]
21
+ [SerializeField] protected Image image = null;
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ [Tooltip("")]
27
+ [FormerlySerializedAs("selectImage")]
28
+ [SerializeField] protected Sprite selectedSprite = null;
29
+
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ [Header("")]
35
+ [Divider]
36
+ [Tooltip("")]
37
+ [SerializeField] protected bool colorImage = false;
38
+
39
+ /// <summary>
40
+ ///
41
+ /// </summary>
42
+ [Tooltip("")]
43
+ [FormerlySerializedAs("initialText")]
44
+ [SerializeField] protected Color initialColor = Color.black;
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ [Tooltip("")]
50
+ [FormerlySerializedAs("selectText")]
51
+ [SerializeField] protected Color selectedColor = Color.white;
52
+
53
+ /// <summary>
54
+ ///
55
+ /// </summary>
56
+ [Divider]
57
+
58
+ [Tooltip("")]
59
+ [SerializeField] protected bool enableMode = false;
60
+
61
+
62
+ /// <summary>
63
+ ///
64
+ /// </summary>
65
+ protected Sprite initialSprite = null;
66
+
67
+
68
+ /// <summary>
69
+ ///
70
+ /// </summary>
71
+ protected virtual void Awake()
72
+ {
73
+ if (!image)
74
+ image = GetComponent<Image>();
75
+
76
+ if (!enableMode && image)
77
+ initialSprite = image.sprite;
78
+
79
+ if (colorImage)
80
+ initialColor = image.color;
81
+ }
82
+
83
+ /// <inheritdoc/>
84
+ public override void Select()
85
+ {
86
+ if (enableMode && !image.enabled)
87
+ image.enabled = true;
88
+
89
+ if (!enableMode && image && selectedSprite)
90
+ image.sprite = selectedSprite;
91
+
92
+ if (colorImage)
93
+ image.color = selectedColor;
94
+ }
95
+
96
+ /// <inheritdoc/>
97
+ public override void Deselect()
98
+ {
99
+ if (enableMode && image.enabled)
100
+ image.enabled = false;
101
+
102
+ if (!enableMode && image)
103
+ image.sprite = initialSprite;
104
+
105
+ if (colorImage)
106
+ image.color = initialColor;
107
+ }
108
+ }
109
109
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 46ab4d7e2da580f4faf14f01eaa7913c
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: 46ab4d7e2da580f4faf14f01eaa7913c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: