@@ -94,15 +94,13 @@ class PolyGridItem : DraggableListItem<PolyGridAsset, string>, IPlaceSceneObject
9494 Action < float > m_CompleteHoverTransition ;
9595 Action < float > m_SetThumbnailScale ;
9696 Action < float > m_SetImportingScale ;
97-
9897 Action < Color > m_SetImportingColor ;
9998
10099 void Awake ( )
101100 {
102101 m_CompleteHoverTransition = CompleteHoverTransition ;
103102 m_SetThumbnailScale = SetThumbnailScale ;
104103 m_SetImportingScale = SetImportingScale ;
105-
106104 m_SetImportingColor = SetImportingColor ;
107105 }
108106
@@ -422,7 +420,8 @@ IEnumerator AnimateVisibility(bool visible, Action<PolyGridItem> callback)
422420 while ( currentTime < k_TransitionDuration )
423421 {
424422 currentTime += Time . deltaTime ;
425- transform . localScale = Vector3 . Lerp ( currentScale , targetScale , currentTime / k_TransitionDuration ) ;
423+ transform . localScale = Vector3 . Lerp ( currentScale , targetScale ,
424+ MathUtilsExt . SmoothInOutLerpFloat ( currentTime / k_TransitionDuration ) ) ;
426425 yield return null ;
427426 }
428427
@@ -446,8 +445,7 @@ IEnumerator ShowGrabbedObject()
446445 currentPreviewOffset = m_PreviewObjectClone . localPosition ;
447446
448447 var currentTime = 0f ;
449- var currentVelocity = 0f ;
450- const float kDuration = 1f ;
448+ const float duration = 1f ;
451449
452450 var targetScale = Vector3 . one * k_IconPreviewScale ;
453451 var pivotOffset = Vector3 . zero ;
@@ -484,13 +482,14 @@ IEnumerator ShowGrabbedObject()
484482 }
485483 }
486484
487- while ( currentTime < kDuration - 0.05f )
485+ while ( currentTime < duration )
488486 {
489487 if ( m_DragObject == null )
490488 yield break ; // Exit coroutine if m_GrabbedObject is destroyed before the loop is finished
491489
492- currentTime = MathUtilsExt . SmoothDamp ( currentTime , kDuration , ref currentVelocity , 0.5f , Mathf . Infinity , Time . deltaTime ) ;
493- m_DragObject . localScale = Vector3 . Lerp ( currentLocalScale , targetScale , currentTime ) ;
490+ currentTime += Time . deltaTime ;
491+ m_DragObject . localScale = Vector3 . Lerp ( currentLocalScale , targetScale ,
492+ MathUtilsExt . SmoothInOutLerpFloat ( currentTime / duration ) ) ;
494493
495494 if ( m_PreviewObjectClone )
496495 {
@@ -501,7 +500,8 @@ IEnumerator ShowGrabbedObject()
501500 yield return null ;
502501 }
503502
504- m_DragObject . localScale = targetScale ;
503+ m_DragObject . localScale = targetScale ;
504+ //No need to hard-set the preview object position/rotation because they will set in OnDragging in parent class
505505 }
506506
507507 static IEnumerator HideGrabbedObject ( GameObject itemToHide )
0 commit comments