com.wallstop-studios.unity-helpers 2.0.0-rc77.9 → 2.0.0-rc78

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,10 +1,14 @@
1
- namespace WallstopStudios.UnityHelpers.Editor.Visuals
1
+ /*
2
+ Original implementation provided by JWoe
3
+ */
4
+ namespace WallstopStudios.UnityHelpers.Editor.Visuals
2
5
  {
3
6
  #if UNITY_EDITOR
4
7
  using System;
5
8
  using UnityEditor;
9
+ using UnityEditor.SceneManagement;
6
10
  using UnityEngine;
7
- using UnityEngine.UI;
11
+ using UnityEngine.SceneManagement;
8
12
  using WallstopStudios.UnityHelpers.Core.Helper;
9
13
  using WallstopStudios.UnityHelpers.Visuals.UGUI;
10
14
  using Object = UnityEngine.Object;
@@ -15,7 +19,7 @@
15
19
  */
16
20
  [CustomEditor(typeof(EnhancedImage))]
17
21
  [CanEditMultipleObjects]
18
- public sealed class ImageExtendedEditor : UnityEditor.UI.ImageEditor
22
+ public sealed class ExtendedImageEditor : UnityEditor.UI.ImageEditor
19
23
  {
20
24
  private SerializedProperty _hdrColorProperty;
21
25
  private SerializedProperty _shapeMaskProperty;
@@ -94,28 +98,54 @@
94
98
  }
95
99
  }
96
100
 
97
- // Set the icon for ImageExtended to match the icon of the Image component
101
+ // Set the icon for ExtendedImages to match the icon of the Image component
98
102
  [InitializeOnLoad]
99
- public static class ImageExtendedIcon
103
+ public static class ExtendedImageIcon
100
104
  {
105
+ private const string SingletonName = "_ICON_OBJECT_SINGLETON_";
106
+
101
107
  private static EnhancedImage IconReference;
102
108
 
103
- static ImageExtendedIcon()
109
+ static ExtendedImageIcon()
110
+ {
111
+ RegenerateIconSingleton();
112
+ EnsureSingletonLifecycle();
113
+ }
114
+
115
+ private static void EnsureSingletonLifecycle()
104
116
  {
105
- IconReference = new GameObject("Icon Object")
117
+ AssemblyReloadEvents.beforeAssemblyReload += SingletonIconCleanup;
118
+ EditorApplication.quitting += SingletonIconCleanup;
119
+
120
+ EditorSceneManager.sceneOpened += (_, _) => RegenerateIconSingleton();
121
+ EditorSceneManager.newSceneCreated += (_, _, _) => RegenerateIconSingleton();
122
+ SceneManager.sceneLoaded += (_, _) => RegenerateIconSingleton();
123
+ SceneManager.activeSceneChanged += (_, _) => RegenerateIconSingleton();
124
+ }
125
+
126
+ private static void RegenerateIconSingleton()
127
+ {
128
+ GameObject existingSingleton = GameObject.Find(SingletonName);
129
+ if (existingSingleton == null)
130
+ {
131
+ IconReference = new GameObject(SingletonName)
132
+ {
133
+ hideFlags = HideFlags.HideAndDontSave,
134
+ }.AddComponent<EnhancedImage>();
135
+ }
136
+ else
106
137
  {
107
- hideFlags = HideFlags.HideAndDontSave,
108
- }.AddComponent<EnhancedImage>();
138
+ IconReference = existingSingleton.GetOrAddComponent<EnhancedImage>();
139
+ IconReference.hideFlags = HideFlags.HideAndDontSave;
140
+ }
109
141
 
110
142
  EditorGUIUtility.SetIconForObject(
111
143
  MonoScript.FromMonoBehaviour(IconReference),
112
144
  EditorGUIUtility.IconContent("Image Icon").image as Texture2D
113
145
  );
114
-
115
- AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload;
116
146
  }
117
147
 
118
- private static void OnBeforeAssemblyReload()
148
+ private static void SingletonIconCleanup()
119
149
  {
120
150
  if (IconReference == null)
121
151
  {
package/README.md CHANGED
@@ -173,6 +173,15 @@ Assert.AreEqual(myCoolGameObject, nearestNeighbors[0]);
173
173
  ## Note
174
174
  All spatial trees expect the positional data to be *immutable*. It is very important that the positions do not change. If they do, you will need to reconstruct the tree.
175
175
 
176
+ ## Shaders
177
+
178
+ | Name | Description |
179
+ | ---- | ----------- |
180
+ | BackgroundMask | Used to simulate a `blur` effect for arbitrary shapes. You will need a reference image, as well as a blurred copy using either a photo editing application or the provided `Image Blur` tool. |
181
+ | DebugDisplayValue | Displays numerical values on top of a texture. Useful to visually track texture instances. |
182
+
176
183
  ## Contributing
177
184
 
178
- This project uses [CSharpier](https://csharpier.com/) with the default configuration to enable an enforced, consistent style. If you would like to contribute, recommendation is to ensure that changed files are ran through CSharpier prior to merge. This can be done automatically through editor plugins, or, minimally, by installing a [pre-commit hook](https://pre-commit.com/#3-install-the-git-hook-scripts).
185
+ This project uses [CSharpier](https://csharpier.com/) with the default configuration to enable an enforced, consistent style. If you would like to contribute, recommendation is to ensure that changed files are ran through CSharpier prior to merge. This can be done automatically through editor plugins, or, minimally, by installing a [pre-commit hook](https://pre-commit.com/#3-install-the-git-hook-scripts).
186
+
187
+ If you think there is something useful that you would like to see, please open an issue or contact me directly.
@@ -1,4 +1,8 @@
1
- using System.Runtime.CompilerServices;
1
+ /*
2
+ Original implementation provided by JWoe
3
+ */
4
+
5
+ using System.Runtime.CompilerServices;
2
6
 
3
7
  [assembly: InternalsVisibleTo("WallstopStudios.UnityHelpers.Editor", AllInternalsVisible = true)]
4
8
 
@@ -22,14 +26,17 @@ namespace WallstopStudios.UnityHelpers.Visuals.UGUI
22
26
  {
23
27
  return;
24
28
  }
29
+
25
30
  _hdrColor = value;
26
31
  UpdateMaterialInstance();
27
32
  }
28
33
  }
29
34
 
30
- // ShapeMask: This functionality mimics Unity's UI mask components, but works with custom materials
31
- // To function, your image material must use a shader with a Texture2D property of this name, its
32
- // alpha mapped to the sprite shader's alpha
35
+ /*
36
+ ShapeMask: This functionality mimics Unity's UI mask components, but works with custom materials.
37
+ To function, your image material must use a shader with a Texture2D property of this name, its
38
+ alpha mapped to the sprite shader's alpha.
39
+ */
33
40
  [FormerlySerializedAs("shapeMask")]
34
41
  [SerializeField]
35
42
  internal Texture2D _shapeMask;
@@ -0,0 +1,835 @@
1
+ {
2
+ "m_SGVersion": 3,
3
+ "m_Type": "UnityEditor.ShaderGraph.GraphData",
4
+ "m_ObjectId": "3cb1871000b64cbcacf41c5eaa2ca160",
5
+ "m_Properties": [
6
+ {
7
+ "m_Id": "e88f9a66bcab47edb18b3823275a59de"
8
+ },
9
+ {
10
+ "m_Id": "192d7e4763764c848a2fdc2fd8312b7f"
11
+ },
12
+ {
13
+ "m_Id": "c25958e6230c44eb94aac7fa3f8b622b"
14
+ }
15
+ ],
16
+ "m_Keywords": [],
17
+ "m_Dropdowns": [],
18
+ "m_CategoryData": [
19
+ {
20
+ "m_Id": "b7a438d5464f469b96f048572d02c30f"
21
+ }
22
+ ],
23
+ "m_Nodes": [
24
+ {
25
+ "m_Id": "57619d76835a4c0f9f9f2e5f6964a582"
26
+ },
27
+ {
28
+ "m_Id": "6023d2787c2a413592adc89a2da7fb7e"
29
+ },
30
+ {
31
+ "m_Id": "52aa7fc32806411b9f3c40735f7d1f9e"
32
+ },
33
+ {
34
+ "m_Id": "0d79c23727a84ed1aef5bea39374aa8f"
35
+ },
36
+ {
37
+ "m_Id": "70efbe6790d34735bacf3b8f0e1dd049"
38
+ },
39
+ {
40
+ "m_Id": "4e09fee637f0488c85ba836a08c7e054"
41
+ },
42
+ {
43
+ "m_Id": "f1a3e0fb00fd4131abd6cea0b166a578"
44
+ }
45
+ ],
46
+ "m_GroupDatas": [],
47
+ "m_StickyNoteDatas": [],
48
+ "m_Edges": [
49
+ {
50
+ "m_OutputSlot": {
51
+ "m_Node": {
52
+ "m_Id": "0d79c23727a84ed1aef5bea39374aa8f"
53
+ },
54
+ "m_SlotId": 0
55
+ },
56
+ "m_InputSlot": {
57
+ "m_Node": {
58
+ "m_Id": "6023d2787c2a413592adc89a2da7fb7e"
59
+ },
60
+ "m_SlotId": 0
61
+ }
62
+ },
63
+ {
64
+ "m_OutputSlot": {
65
+ "m_Node": {
66
+ "m_Id": "4e09fee637f0488c85ba836a08c7e054"
67
+ },
68
+ "m_SlotId": 2
69
+ },
70
+ "m_InputSlot": {
71
+ "m_Node": {
72
+ "m_Id": "52aa7fc32806411b9f3c40735f7d1f9e"
73
+ },
74
+ "m_SlotId": 1
75
+ }
76
+ },
77
+ {
78
+ "m_OutputSlot": {
79
+ "m_Node": {
80
+ "m_Id": "52aa7fc32806411b9f3c40735f7d1f9e"
81
+ },
82
+ "m_SlotId": 3
83
+ },
84
+ "m_InputSlot": {
85
+ "m_Node": {
86
+ "m_Id": "6023d2787c2a413592adc89a2da7fb7e"
87
+ },
88
+ "m_SlotId": 1
89
+ }
90
+ },
91
+ {
92
+ "m_OutputSlot": {
93
+ "m_Node": {
94
+ "m_Id": "6023d2787c2a413592adc89a2da7fb7e"
95
+ },
96
+ "m_SlotId": 2
97
+ },
98
+ "m_InputSlot": {
99
+ "m_Node": {
100
+ "m_Id": "57619d76835a4c0f9f9f2e5f6964a582"
101
+ },
102
+ "m_SlotId": 1
103
+ }
104
+ },
105
+ {
106
+ "m_OutputSlot": {
107
+ "m_Node": {
108
+ "m_Id": "70efbe6790d34735bacf3b8f0e1dd049"
109
+ },
110
+ "m_SlotId": 0
111
+ },
112
+ "m_InputSlot": {
113
+ "m_Node": {
114
+ "m_Id": "4e09fee637f0488c85ba836a08c7e054"
115
+ },
116
+ "m_SlotId": 1
117
+ }
118
+ },
119
+ {
120
+ "m_OutputSlot": {
121
+ "m_Node": {
122
+ "m_Id": "f1a3e0fb00fd4131abd6cea0b166a578"
123
+ },
124
+ "m_SlotId": 0
125
+ },
126
+ "m_InputSlot": {
127
+ "m_Node": {
128
+ "m_Id": "52aa7fc32806411b9f3c40735f7d1f9e"
129
+ },
130
+ "m_SlotId": 2
131
+ }
132
+ }
133
+ ],
134
+ "m_VertexContext": {
135
+ "m_Position": {
136
+ "x": 0.0,
137
+ "y": 0.0
138
+ },
139
+ "m_Blocks": []
140
+ },
141
+ "m_FragmentContext": {
142
+ "m_Position": {
143
+ "x": 0.0,
144
+ "y": 0.0
145
+ },
146
+ "m_Blocks": []
147
+ },
148
+ "m_PreviewData": {
149
+ "serializedMesh": {
150
+ "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
151
+ "m_Guid": ""
152
+ },
153
+ "preventRotation": false
154
+ },
155
+ "m_Path": "Sub Graphs",
156
+ "m_GraphPrecision": 1,
157
+ "m_PreviewMode": 1,
158
+ "m_OutputNode": {
159
+ "m_Id": "57619d76835a4c0f9f9f2e5f6964a582"
160
+ },
161
+ "m_SubDatas": [],
162
+ "m_ActiveTargets": []
163
+ }
164
+
165
+ {
166
+ "m_SGVersion": 0,
167
+ "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
168
+ "m_ObjectId": "0d79c23727a84ed1aef5bea39374aa8f",
169
+ "m_Group": {
170
+ "m_Id": ""
171
+ },
172
+ "m_Name": "Property",
173
+ "m_DrawState": {
174
+ "m_Expanded": true,
175
+ "m_Position": {
176
+ "serializedVersion": "2",
177
+ "x": -149.0,
178
+ "y": -217.0,
179
+ "width": 104.0,
180
+ "height": 34.0
181
+ }
182
+ },
183
+ "m_Slots": [
184
+ {
185
+ "m_Id": "5b3d0702b6824baaab188160b3ccbd4a"
186
+ }
187
+ ],
188
+ "synonyms": [],
189
+ "m_Precision": 0,
190
+ "m_PreviewExpanded": true,
191
+ "m_DismissedVersion": 0,
192
+ "m_PreviewMode": 0,
193
+ "m_CustomColors": {
194
+ "m_SerializableColors": []
195
+ },
196
+ "m_Property": {
197
+ "m_Id": "e88f9a66bcab47edb18b3823275a59de"
198
+ }
199
+ }
200
+
201
+ {
202
+ "m_SGVersion": 0,
203
+ "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
204
+ "m_ObjectId": "108cd2167dca427694c992756e439183",
205
+ "m_Id": 0,
206
+ "m_DisplayName": "A",
207
+ "m_SlotType": 0,
208
+ "m_Hidden": false,
209
+ "m_ShaderOutputName": "A",
210
+ "m_StageCapability": 3,
211
+ "m_Value": {
212
+ "x": 2.0,
213
+ "y": 0.0,
214
+ "z": 0.0,
215
+ "w": 0.0
216
+ },
217
+ "m_DefaultValue": {
218
+ "x": 0.0,
219
+ "y": 0.0,
220
+ "z": 0.0,
221
+ "w": 0.0
222
+ }
223
+ }
224
+
225
+ {
226
+ "m_SGVersion": 1,
227
+ "m_Type": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty",
228
+ "m_ObjectId": "192d7e4763764c848a2fdc2fd8312b7f",
229
+ "m_Guid": {
230
+ "m_GuidSerialized": "147ba223-4abf-412e-8d45-280efd718eb0"
231
+ },
232
+ "m_Name": "OptionalOffset",
233
+ "m_DefaultRefNameVersion": 1,
234
+ "m_RefNameGeneratedByDisplayName": "OptionalOffset",
235
+ "m_DefaultReferenceName": "_OptionalOffset",
236
+ "m_OverrideReferenceName": "",
237
+ "m_GeneratePropertyBlock": true,
238
+ "m_UseCustomSlotLabel": false,
239
+ "m_CustomSlotLabel": "",
240
+ "m_DismissedVersion": 0,
241
+ "m_Precision": 0,
242
+ "overrideHLSLDeclaration": false,
243
+ "hlslDeclarationOverride": 0,
244
+ "m_Hidden": false,
245
+ "m_Value": {
246
+ "x": -1.2999999523162842,
247
+ "y": 0.44999998807907107,
248
+ "z": 0.0,
249
+ "w": 0.0
250
+ }
251
+ }
252
+
253
+ {
254
+ "m_SGVersion": 0,
255
+ "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
256
+ "m_ObjectId": "1d716d779582403fb2307f3780d86901",
257
+ "m_Id": 0,
258
+ "m_DisplayName": "val",
259
+ "m_SlotType": 0,
260
+ "m_Hidden": false,
261
+ "m_ShaderOutputName": "val",
262
+ "m_StageCapability": 3,
263
+ "m_Value": 257.0,
264
+ "m_DefaultValue": 0.0,
265
+ "m_Labels": []
266
+ }
267
+
268
+ {
269
+ "m_SGVersion": 0,
270
+ "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
271
+ "m_ObjectId": "22136fcfaacc4d37bd3a2bae4ada86f5",
272
+ "m_Id": 0,
273
+ "m_DisplayName": "OptionalOffset",
274
+ "m_SlotType": 1,
275
+ "m_Hidden": false,
276
+ "m_ShaderOutputName": "Out",
277
+ "m_StageCapability": 3,
278
+ "m_Value": {
279
+ "x": 0.0,
280
+ "y": 0.0
281
+ },
282
+ "m_DefaultValue": {
283
+ "x": 0.0,
284
+ "y": 0.0
285
+ },
286
+ "m_Labels": []
287
+ }
288
+
289
+ {
290
+ "m_SGVersion": 0,
291
+ "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
292
+ "m_ObjectId": "30450a9c81ce488d9adaa3cd86090c5d",
293
+ "m_Id": 3,
294
+ "m_DisplayName": "Out",
295
+ "m_SlotType": 1,
296
+ "m_Hidden": false,
297
+ "m_ShaderOutputName": "Out",
298
+ "m_StageCapability": 3,
299
+ "m_Value": {
300
+ "x": 0.0,
301
+ "y": 0.0
302
+ },
303
+ "m_DefaultValue": {
304
+ "x": 0.0,
305
+ "y": 0.0
306
+ },
307
+ "m_Labels": []
308
+ }
309
+
310
+ {
311
+ "m_SGVersion": 0,
312
+ "m_Type": "UnityEditor.ShaderGraph.DivideNode",
313
+ "m_ObjectId": "4e09fee637f0488c85ba836a08c7e054",
314
+ "m_Group": {
315
+ "m_Id": ""
316
+ },
317
+ "m_Name": "Divide",
318
+ "m_DrawState": {
319
+ "m_Expanded": true,
320
+ "m_Position": {
321
+ "serializedVersion": "2",
322
+ "x": -589.0,
323
+ "y": -217.0,
324
+ "width": 126.0,
325
+ "height": 118.0
326
+ }
327
+ },
328
+ "m_Slots": [
329
+ {
330
+ "m_Id": "108cd2167dca427694c992756e439183"
331
+ },
332
+ {
333
+ "m_Id": "f809a67e185f4abe8f886f9d16cdc866"
334
+ },
335
+ {
336
+ "m_Id": "fa456dda2be4481498c957140407cad5"
337
+ }
338
+ ],
339
+ "synonyms": [
340
+ "division",
341
+ "divided by"
342
+ ],
343
+ "m_Precision": 0,
344
+ "m_PreviewExpanded": false,
345
+ "m_DismissedVersion": 0,
346
+ "m_PreviewMode": 0,
347
+ "m_CustomColors": {
348
+ "m_SerializableColors": []
349
+ }
350
+ }
351
+
352
+ {
353
+ "m_SGVersion": 0,
354
+ "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode",
355
+ "m_ObjectId": "52aa7fc32806411b9f3c40735f7d1f9e",
356
+ "m_Group": {
357
+ "m_Id": ""
358
+ },
359
+ "m_Name": "Tiling And Offset",
360
+ "m_DrawState": {
361
+ "m_Expanded": true,
362
+ "m_Position": {
363
+ "serializedVersion": "2",
364
+ "x": -253.499755859375,
365
+ "y": -148.5,
366
+ "width": 208.0,
367
+ "height": 325.9999694824219
368
+ }
369
+ },
370
+ "m_Slots": [
371
+ {
372
+ "m_Id": "eec959c3f6614fec8487eacef5335b81"
373
+ },
374
+ {
375
+ "m_Id": "eb444a3c5b96497c92a19a6e03bd8d64"
376
+ },
377
+ {
378
+ "m_Id": "838fe009a59a4e73bf7acfddd029f40b"
379
+ },
380
+ {
381
+ "m_Id": "30450a9c81ce488d9adaa3cd86090c5d"
382
+ }
383
+ ],
384
+ "synonyms": [
385
+ "pan",
386
+ "scale"
387
+ ],
388
+ "m_Precision": 0,
389
+ "m_PreviewExpanded": true,
390
+ "m_DismissedVersion": 0,
391
+ "m_PreviewMode": 0,
392
+ "m_CustomColors": {
393
+ "m_SerializableColors": []
394
+ }
395
+ }
396
+
397
+ {
398
+ "m_SGVersion": 0,
399
+ "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode",
400
+ "m_ObjectId": "57619d76835a4c0f9f9f2e5f6964a582",
401
+ "m_Group": {
402
+ "m_Id": ""
403
+ },
404
+ "m_Name": "Output",
405
+ "m_DrawState": {
406
+ "m_Expanded": true,
407
+ "m_Position": {
408
+ "serializedVersion": "2",
409
+ "x": 322.99993896484377,
410
+ "y": -165.00001525878907,
411
+ "width": 119.0,
412
+ "height": 77.0000228881836
413
+ }
414
+ },
415
+ "m_Slots": [
416
+ {
417
+ "m_Id": "a97ef763a24e4599b0817d71e0c0883b"
418
+ }
419
+ ],
420
+ "synonyms": [],
421
+ "m_Precision": 0,
422
+ "m_PreviewExpanded": true,
423
+ "m_DismissedVersion": 0,
424
+ "m_PreviewMode": 0,
425
+ "m_CustomColors": {
426
+ "m_SerializableColors": []
427
+ },
428
+ "IsFirstSlotValid": true
429
+ }
430
+
431
+ {
432
+ "m_SGVersion": 0,
433
+ "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
434
+ "m_ObjectId": "5b3d0702b6824baaab188160b3ccbd4a",
435
+ "m_Id": 0,
436
+ "m_DisplayName": "Value",
437
+ "m_SlotType": 1,
438
+ "m_Hidden": false,
439
+ "m_ShaderOutputName": "Out",
440
+ "m_StageCapability": 3,
441
+ "m_Value": 0.0,
442
+ "m_DefaultValue": 0.0,
443
+ "m_Labels": []
444
+ }
445
+
446
+ {
447
+ "m_SGVersion": 1,
448
+ "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
449
+ "m_ObjectId": "6023d2787c2a413592adc89a2da7fb7e",
450
+ "m_Group": {
451
+ "m_Id": ""
452
+ },
453
+ "m_Name": "DoDebug (Custom Function)",
454
+ "m_DrawState": {
455
+ "m_Expanded": true,
456
+ "m_Position": {
457
+ "serializedVersion": "2",
458
+ "x": 45.499755859375,
459
+ "y": -165.5,
460
+ "width": 208.0,
461
+ "height": 302.0
462
+ }
463
+ },
464
+ "m_Slots": [
465
+ {
466
+ "m_Id": "1d716d779582403fb2307f3780d86901"
467
+ },
468
+ {
469
+ "m_Id": "a26ec219a2554cc7b68b3ab84fc502f0"
470
+ },
471
+ {
472
+ "m_Id": "e4f2a33d8737498787482c1ec2a22b72"
473
+ }
474
+ ],
475
+ "synonyms": [
476
+ "code",
477
+ "HLSL"
478
+ ],
479
+ "m_Precision": 0,
480
+ "m_PreviewExpanded": true,
481
+ "m_DismissedVersion": 0,
482
+ "m_PreviewMode": 0,
483
+ "m_CustomColors": {
484
+ "m_SerializableColors": []
485
+ },
486
+ "m_SourceType": 1,
487
+ "m_FunctionName": "DoDebug",
488
+ "m_FunctionSource": "",
489
+ "m_FunctionBody": "// Inline everything to avoid nested function definitions\r\n// Based on ShaderToy by @P_Malin: https://www.shadertoy.com/view/4sBSWW\r\n\r\nres = float4(0,0,0,1);\r\n\r\n// Scale UV coordinates for text display\r\nfloat2 vStringCoords = (uv * 200 - float2(10,100)) / float2(8,15);\r\n\r\n// Check if we're in the valid text area\r\nif ((vStringCoords.y >= 0.0) && (vStringCoords.y < 1.0))\r\n{\r\n bool bNeg = (val < 0.0);\r\n float fValue = abs(val);\r\n \r\n float fLog10Value = log2(abs(fValue)) / log2(10.0);\r\n float fBiggestIndex = max(floor(fLog10Value), 0.0);\r\n float fDigitIndex = 10.0 - floor(vStringCoords.x); // 10 max digits\r\n float fCharBin = 0.0;\r\n \r\n if (fDigitIndex > (-3.0 - 1.01)) // 3 decimal places\r\n {\r\n if(fDigitIndex > fBiggestIndex)\r\n {\r\n if((bNeg) && (fDigitIndex < (fBiggestIndex+1.5))) fCharBin = 1792.0; // minus sign\r\n }\r\n else\r\n {\r\n if(fDigitIndex == -1.0)\r\n {\r\n if(3.0 > 0.0) fCharBin = 2.0; // decimal point\r\n }\r\n else\r\n {\r\n float fReducedRangeValue = fValue;\r\n if(fDigitIndex < 0.0) { fReducedRangeValue = frac( fValue ); fDigitIndex += 1.0; }\r\n float fDigitValue = (abs(fReducedRangeValue / (pow(10.0, fDigitIndex))));\r\n int digitIndex = int(floor(fmod(fDigitValue, 10.0)));\r\n \r\n // Inline digit bitmap lookup\r\n fCharBin = digitIndex==0?480599.0:digitIndex==1?139810.0:digitIndex==2?476951.0:digitIndex==3?476999.0:digitIndex==4?350020.0:digitIndex==5?464711.0:digitIndex==6?464727.0:digitIndex==7?476228.0:digitIndex==8?481111.0:digitIndex==9?481095.0:0.0;\r\n }\r\n }\r\n }\r\n \r\n // Extract the pixel from the character bitmap\r\n float debugValue = floor(fmod((fCharBin / pow(2.0, floor(frac(vStringCoords.x) * 4.0) + (floor(vStringCoords.y * 5.0) * 4.0))), 2.0));\r\n res = float4(debugValue, debugValue, debugValue, 1);\r\n}"
490
+ }
491
+
492
+ {
493
+ "m_SGVersion": 0,
494
+ "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
495
+ "m_ObjectId": "6e511d4b34024eac872f89794dae3f26",
496
+ "m_Id": 0,
497
+ "m_DisplayName": "OptionalSize",
498
+ "m_SlotType": 1,
499
+ "m_Hidden": false,
500
+ "m_ShaderOutputName": "Out",
501
+ "m_StageCapability": 3,
502
+ "m_Value": 0.0,
503
+ "m_DefaultValue": 0.0,
504
+ "m_Labels": []
505
+ }
506
+
507
+ {
508
+ "m_SGVersion": 0,
509
+ "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
510
+ "m_ObjectId": "70efbe6790d34735bacf3b8f0e1dd049",
511
+ "m_Group": {
512
+ "m_Id": ""
513
+ },
514
+ "m_Name": "Property",
515
+ "m_DrawState": {
516
+ "m_Expanded": true,
517
+ "m_Position": {
518
+ "serializedVersion": "2",
519
+ "x": -810.0,
520
+ "y": -148.0,
521
+ "width": 141.0,
522
+ "height": 34.0
523
+ }
524
+ },
525
+ "m_Slots": [
526
+ {
527
+ "m_Id": "6e511d4b34024eac872f89794dae3f26"
528
+ }
529
+ ],
530
+ "synonyms": [],
531
+ "m_Precision": 0,
532
+ "m_PreviewExpanded": true,
533
+ "m_DismissedVersion": 0,
534
+ "m_PreviewMode": 0,
535
+ "m_CustomColors": {
536
+ "m_SerializableColors": []
537
+ },
538
+ "m_Property": {
539
+ "m_Id": "c25958e6230c44eb94aac7fa3f8b622b"
540
+ }
541
+ }
542
+
543
+ {
544
+ "m_SGVersion": 0,
545
+ "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
546
+ "m_ObjectId": "838fe009a59a4e73bf7acfddd029f40b",
547
+ "m_Id": 2,
548
+ "m_DisplayName": "Offset",
549
+ "m_SlotType": 0,
550
+ "m_Hidden": false,
551
+ "m_ShaderOutputName": "Offset",
552
+ "m_StageCapability": 3,
553
+ "m_Value": {
554
+ "x": -1.2999999523162842,
555
+ "y": 0.44999998807907107
556
+ },
557
+ "m_DefaultValue": {
558
+ "x": 0.0,
559
+ "y": 0.0
560
+ },
561
+ "m_Labels": []
562
+ }
563
+
564
+ {
565
+ "m_SGVersion": 0,
566
+ "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
567
+ "m_ObjectId": "a26ec219a2554cc7b68b3ab84fc502f0",
568
+ "m_Id": 1,
569
+ "m_DisplayName": "uv",
570
+ "m_SlotType": 0,
571
+ "m_Hidden": false,
572
+ "m_ShaderOutputName": "uv",
573
+ "m_StageCapability": 3,
574
+ "m_Value": {
575
+ "x": 0.0,
576
+ "y": 0.0
577
+ },
578
+ "m_DefaultValue": {
579
+ "x": 0.0,
580
+ "y": 0.0
581
+ },
582
+ "m_Labels": []
583
+ }
584
+
585
+ {
586
+ "m_SGVersion": 0,
587
+ "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
588
+ "m_ObjectId": "a97ef763a24e4599b0817d71e0c0883b",
589
+ "m_Id": 1,
590
+ "m_DisplayName": "Out_Vector4",
591
+ "m_SlotType": 0,
592
+ "m_Hidden": false,
593
+ "m_ShaderOutputName": "OutVector4",
594
+ "m_StageCapability": 3,
595
+ "m_Value": {
596
+ "x": 0.0,
597
+ "y": 0.0,
598
+ "z": 0.0,
599
+ "w": 0.0
600
+ },
601
+ "m_DefaultValue": {
602
+ "x": 0.0,
603
+ "y": 0.0,
604
+ "z": 0.0,
605
+ "w": 0.0
606
+ },
607
+ "m_Labels": []
608
+ }
609
+
610
+ {
611
+ "m_SGVersion": 0,
612
+ "m_Type": "UnityEditor.ShaderGraph.CategoryData",
613
+ "m_ObjectId": "b7a438d5464f469b96f048572d02c30f",
614
+ "m_Name": "",
615
+ "m_ChildObjectList": [
616
+ {
617
+ "m_Id": "e88f9a66bcab47edb18b3823275a59de"
618
+ },
619
+ {
620
+ "m_Id": "192d7e4763764c848a2fdc2fd8312b7f"
621
+ },
622
+ {
623
+ "m_Id": "c25958e6230c44eb94aac7fa3f8b622b"
624
+ }
625
+ ]
626
+ }
627
+
628
+ {
629
+ "m_SGVersion": 1,
630
+ "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
631
+ "m_ObjectId": "c25958e6230c44eb94aac7fa3f8b622b",
632
+ "m_Guid": {
633
+ "m_GuidSerialized": "a2577127-6d89-4e8b-9e06-951cd21fede0"
634
+ },
635
+ "m_Name": "OptionalSize",
636
+ "m_DefaultRefNameVersion": 1,
637
+ "m_RefNameGeneratedByDisplayName": "OptionalSize",
638
+ "m_DefaultReferenceName": "_OptionalSize",
639
+ "m_OverrideReferenceName": "",
640
+ "m_GeneratePropertyBlock": true,
641
+ "m_UseCustomSlotLabel": false,
642
+ "m_CustomSlotLabel": "",
643
+ "m_DismissedVersion": 0,
644
+ "m_Precision": 0,
645
+ "overrideHLSLDeclaration": false,
646
+ "hlslDeclarationOverride": 0,
647
+ "m_Hidden": false,
648
+ "m_Value": 1.0,
649
+ "m_FloatType": 0,
650
+ "m_RangeValues": {
651
+ "x": 0.0,
652
+ "y": 1.0
653
+ }
654
+ }
655
+
656
+ {
657
+ "m_SGVersion": 0,
658
+ "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
659
+ "m_ObjectId": "e4f2a33d8737498787482c1ec2a22b72",
660
+ "m_Id": 2,
661
+ "m_DisplayName": "res",
662
+ "m_SlotType": 1,
663
+ "m_Hidden": false,
664
+ "m_ShaderOutputName": "res",
665
+ "m_StageCapability": 3,
666
+ "m_Value": {
667
+ "x": 0.0,
668
+ "y": 0.0,
669
+ "z": 0.0,
670
+ "w": 0.0
671
+ },
672
+ "m_DefaultValue": {
673
+ "x": 0.0,
674
+ "y": 0.0,
675
+ "z": 0.0,
676
+ "w": 0.0
677
+ },
678
+ "m_Labels": []
679
+ }
680
+
681
+ {
682
+ "m_SGVersion": 1,
683
+ "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
684
+ "m_ObjectId": "e88f9a66bcab47edb18b3823275a59de",
685
+ "m_Guid": {
686
+ "m_GuidSerialized": "b85fe900-3246-4076-80b1-5afce0a840b0"
687
+ },
688
+ "m_Name": "Value",
689
+ "m_DefaultRefNameVersion": 1,
690
+ "m_RefNameGeneratedByDisplayName": "Value",
691
+ "m_DefaultReferenceName": "_Value",
692
+ "m_OverrideReferenceName": "",
693
+ "m_GeneratePropertyBlock": true,
694
+ "m_UseCustomSlotLabel": false,
695
+ "m_CustomSlotLabel": "",
696
+ "m_DismissedVersion": 0,
697
+ "m_Precision": 0,
698
+ "overrideHLSLDeclaration": false,
699
+ "hlslDeclarationOverride": 0,
700
+ "m_Hidden": false,
701
+ "m_Value": 0.0,
702
+ "m_FloatType": 0,
703
+ "m_RangeValues": {
704
+ "x": 0.0,
705
+ "y": 1.0
706
+ }
707
+ }
708
+
709
+ {
710
+ "m_SGVersion": 0,
711
+ "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
712
+ "m_ObjectId": "eb444a3c5b96497c92a19a6e03bd8d64",
713
+ "m_Id": 1,
714
+ "m_DisplayName": "Tiling",
715
+ "m_SlotType": 0,
716
+ "m_Hidden": false,
717
+ "m_ShaderOutputName": "Tiling",
718
+ "m_StageCapability": 3,
719
+ "m_Value": {
720
+ "x": 2.0,
721
+ "y": 2.0
722
+ },
723
+ "m_DefaultValue": {
724
+ "x": 1.0,
725
+ "y": 1.0
726
+ },
727
+ "m_Labels": []
728
+ }
729
+
730
+ {
731
+ "m_SGVersion": 0,
732
+ "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
733
+ "m_ObjectId": "eec959c3f6614fec8487eacef5335b81",
734
+ "m_Id": 0,
735
+ "m_DisplayName": "UV",
736
+ "m_SlotType": 0,
737
+ "m_Hidden": false,
738
+ "m_ShaderOutputName": "UV",
739
+ "m_StageCapability": 3,
740
+ "m_Value": {
741
+ "x": 0.0,
742
+ "y": 0.0
743
+ },
744
+ "m_DefaultValue": {
745
+ "x": 0.0,
746
+ "y": 0.0
747
+ },
748
+ "m_Labels": [],
749
+ "m_Channel": 0
750
+ }
751
+
752
+ {
753
+ "m_SGVersion": 0,
754
+ "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
755
+ "m_ObjectId": "f1a3e0fb00fd4131abd6cea0b166a578",
756
+ "m_Group": {
757
+ "m_Id": ""
758
+ },
759
+ "m_Name": "Property",
760
+ "m_DrawState": {
761
+ "m_Expanded": true,
762
+ "m_Position": {
763
+ "serializedVersion": "2",
764
+ "x": -616.0,
765
+ "y": -20.0,
766
+ "width": 153.0,
767
+ "height": 34.0
768
+ }
769
+ },
770
+ "m_Slots": [
771
+ {
772
+ "m_Id": "22136fcfaacc4d37bd3a2bae4ada86f5"
773
+ }
774
+ ],
775
+ "synonyms": [],
776
+ "m_Precision": 0,
777
+ "m_PreviewExpanded": true,
778
+ "m_DismissedVersion": 0,
779
+ "m_PreviewMode": 0,
780
+ "m_CustomColors": {
781
+ "m_SerializableColors": []
782
+ },
783
+ "m_Property": {
784
+ "m_Id": "192d7e4763764c848a2fdc2fd8312b7f"
785
+ }
786
+ }
787
+
788
+ {
789
+ "m_SGVersion": 0,
790
+ "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
791
+ "m_ObjectId": "f809a67e185f4abe8f886f9d16cdc866",
792
+ "m_Id": 1,
793
+ "m_DisplayName": "B",
794
+ "m_SlotType": 0,
795
+ "m_Hidden": false,
796
+ "m_ShaderOutputName": "B",
797
+ "m_StageCapability": 3,
798
+ "m_Value": {
799
+ "x": 2.0,
800
+ "y": 2.0,
801
+ "z": 2.0,
802
+ "w": 2.0
803
+ },
804
+ "m_DefaultValue": {
805
+ "x": 0.0,
806
+ "y": 0.0,
807
+ "z": 0.0,
808
+ "w": 0.0
809
+ }
810
+ }
811
+
812
+ {
813
+ "m_SGVersion": 0,
814
+ "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
815
+ "m_ObjectId": "fa456dda2be4481498c957140407cad5",
816
+ "m_Id": 2,
817
+ "m_DisplayName": "Out",
818
+ "m_SlotType": 1,
819
+ "m_Hidden": false,
820
+ "m_ShaderOutputName": "Out",
821
+ "m_StageCapability": 3,
822
+ "m_Value": {
823
+ "x": 0.0,
824
+ "y": 0.0,
825
+ "z": 0.0,
826
+ "w": 0.0
827
+ },
828
+ "m_DefaultValue": {
829
+ "x": 0.0,
830
+ "y": 0.0,
831
+ "z": 0.0,
832
+ "w": 0.0
833
+ }
834
+ }
835
+
@@ -0,0 +1,10 @@
1
+ fileFormatVersion: 2
2
+ guid: f2e8898c70ae9384c960666ef872faf3
3
+ ScriptedImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 2
7
+ userData:
8
+ assetBundleName:
9
+ assetBundleVariant:
10
+ script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.wallstop-studios.unity-helpers",
3
- "version": "2.0.0-rc77.9",
3
+ "version": "2.0.0-rc78",
4
4
  "displayName": "Unity Helpers",
5
5
  "description": "Various Unity Helper Library",
6
6
  "dependencies": {},
@@ -92,5 +92,6 @@
92
92
 
93
93
 
94
94
 
95
+
95
96
 
96
97