Skip to content

Commit 7b47f86

Browse files
authored
Compile flag support for Unity6 (#493)
* Update CardPopup2D.cs add support for Unity 6 api * Gradient2.ModifyMesh Modify Mesh should respond to gradient key updates in inspector and runtime
1 parent 39a3b8d commit 7b47f86

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Runtime/Scripts/Effects/Gradient2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ List<float> FindStops(float zoomOffset, Rect bounds, List<float> stops)
475475
var startBoundary = zoomOffset - offset;
476476
var endBoundary = (1 - zoomOffset) - offset;
477477

478-
if (_colorKeys == null) _colorKeys = EffectGradient.colorKeys;
478+
_colorKeys = EffectGradient.colorKeys;
479479

480480
foreach (var color in _colorKeys)
481481
{
@@ -485,7 +485,7 @@ List<float> FindStops(float zoomOffset, Rect bounds, List<float> stops)
485485
stops.Add((color.time - startBoundary) * Zoom);
486486
}
487487

488-
if (_alphaKeys == null) _alphaKeys = _effectGradient.alphaKeys;
488+
_alphaKeys = _effectGradient.alphaKeys;
489489

490490
foreach (var alpha in _alphaKeys)
491491
{

Runtime/Scripts/Layout/CardUI/2D Cards/CardPopup2D.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ void Update()
5757
{
5858
isFalling = false;
5959
rbody.useGravity = false;
60-
rbody.velocity = Vector3.zero;
61-
transform.position = new Vector3(0, 8, startZPos);
60+
#if UNITY_6000_0_OR_NEWER
61+
rbody.linearVelocity = Vector3.zero;
62+
#else
63+
rbody.velocity = Vector3.zero;
64+
#endif
65+
transform.position = new Vector3(0, 8, startZPos);
6266
if (singleScene)
6367
{
6468
CardEnter();

0 commit comments

Comments
 (0)