com.wallstop-studios.unity-helpers 2.0.0-rc04 → 2.0.0-rc06

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 (121) hide show
  1. package/CHANGELOG.md.meta +7 -7
  2. package/Editor/AnimationEventEditor.cs.meta +11 -11
  3. package/Editor.meta +8 -8
  4. package/LICENSE.md.meta +7 -7
  5. package/README.md.meta +7 -7
  6. package/Runtime/Core/Attributes/AnimationEventAttribute.cs.meta +11 -11
  7. package/Runtime/Core/Attributes/ChildComponentAttribute.cs.meta +11 -11
  8. package/Runtime/Core/Attributes/KSerializableAttribute.cs.meta +11 -11
  9. package/Runtime/Core/Attributes/NotNullAttribute.cs.meta +11 -11
  10. package/Runtime/Core/Attributes/ParentComponent.cs.meta +11 -11
  11. package/Runtime/Core/Attributes/ReadOnlyAttribute.cs.meta +11 -11
  12. package/Runtime/Core/Attributes/RelationalComponentExtensions.cs.meta +11 -11
  13. package/Runtime/Core/DataStructure/Adapters/FastVector2Int.cs.meta +11 -11
  14. package/Runtime/Core/DataStructure/Adapters/FastVector3Int.cs.meta +11 -11
  15. package/Runtime/Core/DataStructure/Adapters/KGuid.cs.meta +11 -11
  16. package/Runtime/Core/DataStructure/Adapters/KVector2.cs.meta +11 -11
  17. package/Runtime/Core/DataStructure/Adapters.meta +8 -8
  18. package/Runtime/Core/DataStructure/Circle.cs.meta +11 -11
  19. package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +11 -11
  20. package/Runtime/Core/DataStructure/QuadTree.cs.meta +11 -11
  21. package/Runtime/Core/DataStructure/StringWrapper.cs.meta +11 -11
  22. package/Runtime/Core/DataStructure/TimedCache.cs +4 -3
  23. package/Runtime/Core/DataStructure/TimedCache.cs.meta +11 -11
  24. package/Runtime/Core/DataStructure.meta +8 -8
  25. package/Runtime/Core/Extension/AnimatorExtensions.cs.meta +11 -11
  26. package/Runtime/Core/Extension/CircleExtensions.cs.meta +11 -11
  27. package/Runtime/Core/Extension/ColorExtensions.cs.meta +11 -11
  28. package/Runtime/Core/Extension/DictionaryExtensions.cs.meta +11 -11
  29. package/Runtime/Core/Extension/DirectionExtensions.cs.meta +11 -11
  30. package/Runtime/Core/Extension/HashSetExtensions.cs.meta +11 -11
  31. package/Runtime/Core/Extension/IEnumerableExtensions.cs.meta +11 -11
  32. package/Runtime/Core/Extension/IListExtensions.cs +2 -2
  33. package/Runtime/Core/Extension/IListExtensions.cs.meta +11 -11
  34. package/Runtime/Core/Extension/LoggingExtensions.cs.meta +11 -11
  35. package/Runtime/Core/Extension/RandomExtensions.cs +23 -4
  36. package/Runtime/Core/Extension/RandomExtensions.cs.meta +11 -11
  37. package/Runtime/Core/Extension/StringExtensions.cs.meta +11 -11
  38. package/Runtime/Core/Extension/UnityExtensions.cs +278 -90
  39. package/Runtime/Core/Extension/UnityExtensions.cs.meta +11 -11
  40. package/Runtime/Core/Extension.meta +8 -8
  41. package/Runtime/Core/Helper/ArrayConverter.cs +39 -0
  42. package/Runtime/Core/Helper/ArrayConverter.cs.meta +3 -0
  43. package/Runtime/Core/Helper/Enumerables.cs.meta +11 -11
  44. package/Runtime/Core/Helper/Geometry.cs.meta +11 -11
  45. package/Runtime/Core/Helper/Helpers.cs +209 -84
  46. package/Runtime/Core/Helper/LifetimeHelpers.cs.meta +11 -11
  47. package/Runtime/Core/Helper/Objects.cs.meta +11 -11
  48. package/Runtime/Core/Helper/WallMath.cs +85 -22
  49. package/Runtime/Core/Helper/WallMath.cs.meta +11 -11
  50. package/Runtime/Core/Helper.meta +8 -8
  51. package/Runtime/Core/Math/Line.cs.meta +11 -11
  52. package/Runtime/Core/Math/Parabola.cs.meta +11 -11
  53. package/Runtime/Core/Math/Range.cs.meta +11 -11
  54. package/Runtime/Core/Math.meta +8 -8
  55. package/Runtime/Core/Model/Direction.cs.meta +11 -11
  56. package/Runtime/Core/Model.meta +8 -8
  57. package/Runtime/Core/OneOf/FastOneOf.cs.meta +11 -11
  58. package/Runtime/Core/OneOf/None.cs.meta +11 -11
  59. package/Runtime/Core/OneOf.meta +8 -8
  60. package/Runtime/Core/Random/AbstractRandom.cs +34 -20
  61. package/Runtime/Core/Random/AbstractRandom.cs.meta +11 -11
  62. package/Runtime/Core/Random/DotNetRandom.cs +52 -0
  63. package/Runtime/Core/Random/DotNetRandom.cs.meta +3 -0
  64. package/Runtime/Core/Random/IRandom.cs.meta +11 -11
  65. package/Runtime/Core/Random/NativePcgRandom.cs.meta +11 -11
  66. package/Runtime/Core/Random/PRNG.cs +7 -0
  67. package/Runtime/Core/Random/PRNG.cs.meta +3 -0
  68. package/Runtime/Core/Random/PcgRandom.cs +23 -22
  69. package/Runtime/Core/Random/PcgRandom.cs.meta +11 -11
  70. package/Runtime/Core/Random/RandomState.cs +44 -5
  71. package/Runtime/Core/Random/RandomState.cs.meta +11 -11
  72. package/Runtime/Core/Random/SquirrelRandom.cs +13 -10
  73. package/Runtime/Core/Random/SquirrelRandom.cs.meta +11 -11
  74. package/Runtime/Core/Random/SystemRandom.cs +31 -16
  75. package/Runtime/Core/Random/SystemRandom.cs.meta +11 -11
  76. package/Runtime/Core/Random/ThreadLocalRandom.cs +2 -1
  77. package/Runtime/Core/Random/ThreadLocalRandom.cs.meta +11 -11
  78. package/Runtime/Core/Random/UnityRandom.cs +37 -4
  79. package/Runtime/Core/Random/WyRandom.cs +121 -0
  80. package/Runtime/Core/Random/WyRandom.cs.meta +3 -0
  81. package/Runtime/Core/Random/XorShiftRandom.cs +9 -7
  82. package/Runtime/Core/Random.meta +8 -8
  83. package/Runtime/Core/Serialization/JsonConverters/Vector2Converter.cs.meta +11 -11
  84. package/Runtime/Core/Serialization/JsonConverters/Vector3Converter.cs.meta +11 -11
  85. package/Runtime/Core/Serialization/JsonConverters.meta +8 -8
  86. package/Runtime/Core/Serialization/Serializer.cs +36 -14
  87. package/Runtime/Core/Serialization/Serializer.cs.meta +11 -11
  88. package/Runtime/Core/Serialization.meta +8 -8
  89. package/Runtime/Core/Threading/SingleThreadedThreadPool.cs.meta +11 -11
  90. package/Runtime/Core/Threading.meta +8 -8
  91. package/Runtime/Core.meta +8 -8
  92. package/Runtime/Protobuf-Net.meta +8 -8
  93. package/Runtime/Utils/AnimationEventEqualityComparer.cs.meta +11 -11
  94. package/Runtime/Utils/AnimatorEnumStateMachine.cs.meta +11 -11
  95. package/Runtime/Utils/Buffers.cs.meta +11 -11
  96. package/Runtime/Utils/CircleLineRenderer.cs +17 -5
  97. package/Runtime/Utils/CircleLineRenderer.cs.meta +11 -11
  98. package/Runtime/Utils/Oscillator.cs.meta +11 -11
  99. package/Runtime/Utils/SetTextureImportData.cs.meta +11 -11
  100. package/Runtime/Utils.meta +8 -8
  101. package/Runtime/WallstopStudios.UnityHelpers.asmdef.meta +7 -7
  102. package/Runtime.meta +8 -8
  103. package/Tests/Runtime/DataStructures/SpatialTreeTests.cs +34 -10
  104. package/Tests/Runtime/Helper/ArrayConverterTests.cs +19 -0
  105. package/Tests/Runtime/Helper/ArrayConverterTests.cs.meta +3 -0
  106. package/Tests/Runtime/Helper/WallMathTests.cs +221 -0
  107. package/Tests/Runtime/Helper/WallMathTests.cs.meta +3 -0
  108. package/Tests/Runtime/Helper.meta +3 -0
  109. package/Tests/Runtime/Performance/RandomPerformanceTests.cs +18 -13
  110. package/Tests/Runtime/Performance/SpatialTreePerformanceTest.cs +47 -34
  111. package/Tests/Runtime/Random/DotNetRandomTests.cs +9 -0
  112. package/Tests/Runtime/Random/DotNetRandomTests.cs.meta +3 -0
  113. package/Tests/Runtime/Random/RandomTestBase.cs +89 -15
  114. package/Tests/Runtime/Random/WyRandomTests.cs +9 -0
  115. package/Tests/Runtime/Random/WyRandomTests.cs.meta +3 -0
  116. package/Tests/Runtime/Serialization/JsonSerializationTest.cs +24 -11
  117. package/Tests/Runtime/Utils/SpriteRendererMetadataTests.cs +21 -17
  118. package/Tests.meta +8 -8
  119. package/Third Party Notices.md.meta +7 -7
  120. package/package.json +1 -1
  121. package/package.json.meta +7 -7
@@ -2,29 +2,31 @@
2
2
  {
3
3
  using System;
4
4
  using System.Runtime.Serialization;
5
+ using System.Text.Json.Serialization;
5
6
 
6
7
  [Serializable]
8
+ [DataContract]
7
9
  public sealed class XorShiftRandom : AbstractRandom
8
10
  {
9
11
  public static IRandom Instance => ThreadLocalRandom<XorShiftRandom>.Instance;
12
+
10
13
  public override RandomState InternalState => new(_state, 0, _cachedGaussian);
11
14
 
12
- [DataMember(Name = "State")]
13
15
  private uint _state;
14
16
 
15
- public XorShiftRandom() : this(Guid.NewGuid().GetHashCode())
16
- {
17
- }
17
+ public XorShiftRandom()
18
+ : this(Guid.NewGuid().GetHashCode()) { }
18
19
 
19
20
  public XorShiftRandom(int state)
20
21
  {
21
22
  _state = unchecked((uint)state);
22
23
  }
23
24
 
24
- public XorShiftRandom(RandomState state)
25
+ [JsonConstructor]
26
+ public XorShiftRandom(RandomState internalState)
25
27
  {
26
- _state = unchecked((uint)state.State1);
27
- _cachedGaussian = state.Gaussian;
28
+ _state = unchecked((uint)internalState.State1);
29
+ _cachedGaussian = internalState.Gaussian;
28
30
  }
29
31
 
30
32
  public override uint NextUint()
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 89615d17d6d576a4a9c877765fb8abdb
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 89615d17d6d576a4a9c877765fb8abdb
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 1e671babce85bff4a96cf95c1ed6e45a
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: 1e671babce85bff4a96cf95c1ed6e45a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: c54b5af6a3d3cb5488395c0aab58d0f1
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: c54b5af6a3d3cb5488395c0aab58d0f1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: f587675350531c74d881f05c4ef25001
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: f587675350531c74d881f05c4ef25001
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -2,13 +2,13 @@
2
2
  {
3
3
  using System;
4
4
  using System.ComponentModel;
5
- using Extension;
6
- using JsonConverters;
7
5
  using System.IO;
8
6
  using System.Runtime.Serialization.Formatters.Binary;
9
7
  using System.Text;
10
8
  using System.Text.Json;
11
9
  using System.Text.Json.Serialization;
10
+ using Extension;
11
+ using JsonConverters;
12
12
 
13
13
  internal static class SerializerEncoding
14
14
  {
@@ -30,7 +30,7 @@
30
30
  {
31
31
  new JsonStringEnumConverter(),
32
32
  Vector3Converter.Instance,
33
- Vector2Converter.Instance
33
+ Vector2Converter.Instance,
34
34
  },
35
35
  };
36
36
 
@@ -45,7 +45,7 @@
45
45
  {
46
46
  new JsonStringEnumConverter(),
47
47
  Vector3Converter.Instance,
48
- Vector2Converter.Instance
48
+ Vector2Converter.Instance,
49
49
  },
50
50
  WriteIndented = true,
51
51
  };
@@ -70,7 +70,10 @@
70
70
  return ProtoDeserialize<T>(serialized);
71
71
  default:
72
72
  throw new InvalidEnumArgumentException(
73
- nameof(serializationType), (int)serializationType, typeof(SerializationType));
73
+ nameof(serializationType),
74
+ (int)serializationType,
75
+ typeof(SerializationType)
76
+ );
74
77
  }
75
78
  }
76
79
 
@@ -84,7 +87,10 @@
84
87
  return ProtoSerialize(instance);
85
88
  default:
86
89
  throw new InvalidEnumArgumentException(
87
- nameof(serializationType), (int)serializationType, typeof(SerializationType));
90
+ nameof(serializationType),
91
+ (int)serializationType,
92
+ typeof(SerializationType)
93
+ );
88
94
  }
89
95
  }
90
96
 
@@ -123,9 +129,14 @@
123
129
  return memoryStream.ToArray();
124
130
  }
125
131
 
126
- public static T JsonDeserialize<T>(string data)
132
+ public static T JsonDeserialize<T>(string data, Type type = null)
127
133
  {
128
- return JsonSerializer.Deserialize<T>(data, SerializerEncoding.NormalJsonOptions);
134
+ return (T)
135
+ JsonSerializer.Deserialize(
136
+ data,
137
+ type ?? typeof(T),
138
+ SerializerEncoding.NormalJsonOptions
139
+ );
129
140
  }
130
141
 
131
142
  public static byte[] JsonSerialize<T>(T input)
@@ -135,13 +146,24 @@
135
146
 
136
147
  public static string JsonStringify<T>(T input, bool pretty = false)
137
148
  {
138
- JsonSerializerOptions options =
139
- pretty ? SerializerEncoding.PrettyJsonOptions : SerializerEncoding.NormalJsonOptions;
140
- if (typeof(T) == typeof(object))
149
+ JsonSerializerOptions options = pretty
150
+ ? SerializerEncoding.PrettyJsonOptions
151
+ : SerializerEncoding.NormalJsonOptions;
152
+ Type parameterType = typeof(T);
153
+ if (
154
+ parameterType.IsAbstract
155
+ || parameterType.IsInterface
156
+ || parameterType == typeof(object)
157
+ )
141
158
  {
142
159
  object data = input;
143
- Type type = data?.GetType();
144
- return JsonSerializer.Serialize(data, data?.GetType(), options);
160
+ if (data == null)
161
+ {
162
+ return "{}";
163
+ }
164
+
165
+ Type type = data.GetType();
166
+ return JsonSerializer.Serialize(data, type, options);
145
167
  }
146
168
 
147
169
  return JsonSerializer.Serialize(input, options);
@@ -159,4 +181,4 @@
159
181
  File.WriteAllText(path, jsonAsText);
160
182
  }
161
183
  }
162
- }
184
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: e3a5dbeacede7e84ba9bdd7a37267f8a
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: e3a5dbeacede7e84ba9bdd7a37267f8a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: a5624b5006f75b146a68b87ffcbcb64e
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: a5624b5006f75b146a68b87ffcbcb64e
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 6091a7935c3d1df438224d058389dc39
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: 6091a7935c3d1df438224d058389dc39
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 21fb761f52e33444ba9b56e6687093f5
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 21fb761f52e33444ba9b56e6687093f5
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/Runtime/Core.meta CHANGED
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 7198976a47786b24eb8df722066344b5
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 7198976a47786b24eb8df722066344b5
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 0073112e88bcac943986f84e475a287f
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 0073112e88bcac943986f84e475a287f
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 5723e1a7cd396dd46850faa4ba007aaf
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: 5723e1a7cd396dd46850faa4ba007aaf
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 79f211d11bdd01648804f772c64c9726
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: 79f211d11bdd01648804f772c64c9726
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 0351cf6d1c040c84fa9cbe195ab5508e
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: 0351cf6d1c040c84fa9cbe195ab5508e
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -17,7 +17,7 @@
17
17
  public int baseSegments = 4;
18
18
  public float updateRateSeconds = 0.1f;
19
19
  public Color color = Color.grey;
20
-
20
+
21
21
  public Vector3 Offset
22
22
  {
23
23
  get => _offset;
@@ -26,6 +26,7 @@
26
26
 
27
27
  [SiblingComponent]
28
28
  private CircleCollider2D _collider;
29
+
29
30
  [SiblingComponent]
30
31
  private LineRenderer[] _lineRenderers;
31
32
 
@@ -70,7 +71,11 @@
70
71
 
71
72
  if (maxLineWidth < minLineWidth)
72
73
  {
73
- this.LogWarn("MaxLineWidth {0} smaller than MinLineWidth {1}.", maxLineWidth, minLineWidth);
74
+ this.LogWarn(
75
+ "MaxLineWidth {0} smaller than MinLineWidth {1}.",
76
+ maxLineWidth,
77
+ minLineWidth
78
+ );
74
79
  }
75
80
  }
76
81
 
@@ -98,7 +103,10 @@
98
103
  lineRenderer.positionCount = numSegments;
99
104
 
100
105
  // ReSharper disable once CompareOfFloatsByEqualityOperator
101
- float lineWidth = minLineWidth == maxLineWidth ? minLineWidth : PcgRandom.Instance.NextFloat(minLineWidth, maxLineWidth);
106
+ float lineWidth =
107
+ minLineWidth == maxLineWidth
108
+ ? minLineWidth
109
+ : PRNG.Instance.NextFloat(minLineWidth, maxLineWidth);
102
110
 
103
111
  lineRenderer.startWidth = lineWidth;
104
112
  lineRenderer.endWidth = lineWidth;
@@ -106,12 +114,16 @@
106
114
  float distanceMultiplier = _collider.radius;
107
115
 
108
116
  float angle = 360f / numSegments;
109
- float offsetRadians = PcgRandom.Instance.NextFloat(angle);
117
+ float offsetRadians = PRNG.Instance.NextFloat(angle);
110
118
  float currentOffset = offsetRadians;
111
119
  Vector3[] positions = new Vector3[numSegments];
112
120
  for (int i = 0; i < numSegments; ++i)
113
121
  {
114
- positions[i] = new Vector3(Mathf.Cos(Mathf.Deg2Rad * currentOffset), Mathf.Sin(Mathf.Deg2Rad * currentOffset)) * distanceMultiplier;
122
+ positions[i] =
123
+ new Vector3(
124
+ Mathf.Cos(Mathf.Deg2Rad * currentOffset),
125
+ Mathf.Sin(Mathf.Deg2Rad * currentOffset)
126
+ ) * distanceMultiplier;
115
127
  currentOffset += angle % 360f;
116
128
  }
117
129
 
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 1d0268c3b20fd1b4a90000e64b66a97b
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: 1d0268c3b20fd1b4a90000e64b66a97b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: f143adfc6e1409a429bba016d8f2bbe3
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: f143adfc6e1409a429bba016d8f2bbe3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 88a78536726a47a438d250cb8206ce26
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: 88a78536726a47a438d250cb8206ce26
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 21a94927e8953294aa5277276d6a7bfd
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 21a94927e8953294aa5277276d6a7bfd
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 63a0f107903545b4fae68b24d4dd4b41
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 63a0f107903545b4fae68b24d4dd4b41
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Runtime.meta CHANGED
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 4ab0b5c03f18e0845b8a5571f9704c0a
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 4ab0b5c03f18e0845b8a5571f9704c0a
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant: