@@ -184,9 +184,6 @@ public class UIEffectContext
184
184
public float gradationRotation ;
185
185
private List < float > _keyTimes ;
186
186
187
- public bool allowToModifyMeshShape ;
188
-
189
-
190
187
public bool willModifyMaterial => samplingFilter != SamplingFilter . None
191
188
|| transitionFilter != TransitionFilter . None
192
189
|| toneFilter != ToneFilter . None
@@ -254,8 +251,6 @@ public void CopyFrom(UIEffectContext preset)
254
251
gradationOffset = preset . gradationOffset ;
255
252
gradationScale = preset . gradationScale ;
256
253
gradationRotation = preset . gradationRotation ;
257
-
258
- allowToModifyMeshShape = preset . allowToModifyMeshShape ;
259
254
}
260
255
261
256
public void SetGradationDirty ( )
@@ -363,14 +358,14 @@ private static void SetKeyword(Material material, string[] keywords, int index)
363
358
}
364
359
}
365
360
366
- public void ModifyMesh ( Graphic graphic , RectTransform transitionRoot , VertexHelper vh )
361
+ public void ModifyMesh ( Graphic graphic , RectTransform transitionRoot , VertexHelper vh , bool canModifyShape )
367
362
{
368
363
var processor = ContextProcessor . FindProcessor ( graphic ) ;
369
364
var isText = processor . IsText ( graphic ) ;
370
365
processor . OnPreModifyMesh ( graphic ) ;
371
366
372
367
var verts = s_WorkingVertices ;
373
- var expandSize = GetExpandSize ( ) ;
368
+ var expandSize = GetExpandSize ( canModifyShape ) ;
374
369
var count = vh . currentIndexCount ;
375
370
376
371
// Get the rectangle to calculate the normalized position.
@@ -427,7 +422,7 @@ public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelp
427
422
}
428
423
429
424
// Apply gradation.
430
- ApplyGradation ( verts , transitionRoot . rect , rectMatrix ) ;
425
+ ApplyGradation ( verts , transitionRoot . rect , rectMatrix , canModifyShape ) ;
431
426
432
427
// Apply shadow.
433
428
ApplyShadow ( transitionRoot , verts ) ;
@@ -436,7 +431,7 @@ public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelp
436
431
vh . AddUIVertexTriangleStream ( verts ) ;
437
432
}
438
433
439
- private void ApplyGradation ( List < UIVertex > verts , Rect rect , Matrix4x4 m )
434
+ private void ApplyGradation ( List < UIVertex > verts , Rect rect , Matrix4x4 m , bool canModifyShape )
440
435
{
441
436
var a = gradationColor1 ;
442
437
var b = gradationColor2 ;
@@ -476,7 +471,7 @@ private void ApplyGradation(List<UIVertex> verts, Rect rect, Matrix4x4 m)
476
471
GradientUtil . GetKeyTimes ( grad , _keyTimes ) ;
477
472
}
478
473
479
- if ( allowToModifyMeshShape )
474
+ if ( canModifyShape )
480
475
{
481
476
var splitTimes = InternalListPool < float > . Rent ( ) ;
482
477
GradientUtil . SplitKeyTimes ( _keyTimes , splitTimes , offset , scale ) ;
@@ -498,7 +493,7 @@ private void ApplyGradation(List<UIVertex> verts, Rect rect, Matrix4x4 m)
498
493
GradientUtil . GetKeyTimes ( grad , _keyTimes ) ;
499
494
}
500
495
501
- if ( allowToModifyMeshShape )
496
+ if ( canModifyShape )
502
497
{
503
498
var splitTimes = InternalListPool < float > . Rent ( ) ;
504
499
GradientUtil . SplitKeyTimes ( _keyTimes , splitTimes , offset , scale ) ;
@@ -521,7 +516,7 @@ private void ApplyGradation(List<UIVertex> verts, Rect rect, Matrix4x4 m)
521
516
}
522
517
523
518
m = Matrix4x4 . Rotate ( Quaternion . Euler ( 0 , 0 , rot ) ) * m ;
524
- if ( allowToModifyMeshShape )
519
+ if ( canModifyShape )
525
520
{
526
521
var splitTimes = InternalListPool < float > . Rent ( ) ;
527
522
GradientUtil . SplitKeyTimes ( _keyTimes , splitTimes , offset , scale ) ;
@@ -555,9 +550,9 @@ private void ApplyShadow(RectTransform transitionRoot, List<UIVertex> verts)
555
550
}
556
551
}
557
552
558
- private Vector2 GetExpandSize ( )
553
+ private Vector2 GetExpandSize ( bool canModifyShape )
559
554
{
560
- if ( ! allowToModifyMeshShape ) return Vector2 . zero ;
555
+ if ( ! canModifyShape ) return Vector2 . zero ;
561
556
562
557
var expandSize = Vector2 . zero ;
563
558
switch ( samplingFilter )
0 commit comments