Finalize nice animations
This commit is contained in:
@@ -444,23 +444,12 @@ namespace UI.CardSystem
|
||||
private void OnCardShrinkRequested(StateMachine.States.CardAlbumEnlargedState state)
|
||||
{
|
||||
if (state == null) return;
|
||||
// Hide backdrop
|
||||
// Hide backdrop; state will animate back to slot and reparent on completion
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(false);
|
||||
}
|
||||
// Reparent back to original parent and restore local transform
|
||||
var ctx = state.GetComponentInParent<StateMachine.CardContext>();
|
||||
if (ctx != null)
|
||||
{
|
||||
Transform originalParent = state.GetOriginalParent();
|
||||
if (originalParent != null)
|
||||
{
|
||||
ctx.RootTransform.SetParent(originalParent, true);
|
||||
ctx.RootTransform.localPosition = state.GetOriginalLocalPosition();
|
||||
ctx.RootTransform.localRotation = state.GetOriginalLocalRotation();
|
||||
}
|
||||
}
|
||||
// Do not reparent here; reverse animation is orchestrated by the state
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user