Compare commits

..

2 Commits

Author SHA1 Message Date
zhangaotian 6f51f8417e Merge branch 'main' into iOS_release 2024-08-23 13:25:26 +08:00
zhangaotian 6d84180241 【Bug】钉子移动时暂停游戏bug 2024-08-23 13:23:22 +08:00
1 changed files with 5 additions and 5 deletions

View File

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