【Bug】钉子移动时暂停游戏bug

iOS_release
zhangaotian 2024-08-23 13:23:22 +08:00
parent 89e0739f74
commit 6d84180241
1 changed files with 5 additions and 5 deletions

View File

@ -153,6 +153,7 @@ namespace Gameplay.Level
{
try
{
PutThumbtack();
if (_isMoving)
{
_curThumbtack.Obj.layer = 13;
@ -171,8 +172,6 @@ namespace Gameplay.Level
RecoverPlankStatus();
}
}
PutThumbtack();
}
catch (Exception e)
{
@ -180,13 +179,14 @@ namespace Gameplay.Level
}
}
/// <summary>
/// 暂停时提前放置钉子
/// </summary>
private void PutThumbtack()
{
if ((LevelManager.Instance.IsPause || LevelManager.Instance.IsOver) && _curThumbtack != null)
{
_curThumbtack.Obj.GetComponent<SpriteRenderer>().color = _defaultColor;
LevelManager.Instance.CurUndoState.PreModifiedKong.LevelThumbtack = _curThumbtack;
_curThumbtack = null;
_curThumbtack.Obj.transform.position = _target.position;
}
}