[Style] 기보 처음, 끝 클릭 시 시간차를 두고 바둑돌 생성, 사라지게 구현

This commit is contained in:
HaeinLEE 2025-03-24 15:26:41 +09:00
parent b60f838ecb
commit 3021fa3366
2 changed files with 13 additions and 2 deletions

View File

@ -2,6 +2,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
@ -216,21 +217,32 @@ public class ReplayManager : Singleton<ReplayManager>
} }
public void ReplayFirst() public void ReplayFirst()
{
StartCoroutine(IReplayFirst());
}
private IEnumerator IReplayFirst()
{ {
while (_placedStoneStack.Count > 0) while (_placedStoneStack.Count > 0)
{ {
ReplayUndo(_placedStoneStack.Pop()); ReplayUndo(_placedStoneStack.Pop());
yield return new WaitForSeconds(0.1f);
} }
} }
public void ReplayFinish() public void ReplayFinish()
{
StartCoroutine(IReplayFinish());
}
private IEnumerator IReplayFinish()
{ {
while(_placedStoneStack.Count < _selectedReplayRecord.moves.Count) while(_placedStoneStack.Count < _selectedReplayRecord.moves.Count)
{ {
ReplayNext(GetNextMove()); ReplayNext(GetNextMove());
yield return new WaitForSeconds(0.1f);
} }
} }
public string GetPlayerANickname() public string GetPlayerANickname()
{ {
return _selectedReplayRecord.playerA; return _selectedReplayRecord.playerA;

View File

@ -27,7 +27,6 @@ public class ReplayPanelItemsController : ScrollPanelController
records = ReplayManager.Instance.LoadReplayDatas(); records = ReplayManager.Instance.LoadReplayDatas();
foreach (var replayRecord in records) foreach (var replayRecord in records)
{ {
Debug.Log($"{replayRecord.gameDate}의 결과는 {replayRecord.gameResult}");
var replayCellButtonObject = Instantiate(scrollItemPrefab, content.transform); var replayCellButtonObject = Instantiate(scrollItemPrefab, content.transform);
ReplayCell replayCell = replayCellButtonObject.GetComponent<ReplayCell>(); ReplayCell replayCell = replayCellButtonObject.GetComponent<ReplayCell>();