private IEnumerator YakuListCoroutine(PointInfo point, int totalPoints, bool richi, UnityAction callback) { yield return(PointInfoManager.SetPointInfo(point, totalPoints, richi)); yield return(waiting); YakuRankManager.ShowYakuRank(point); ConfirmCountDownController.StartCountDown(MahjongConstants.SummaryPanelWaitingTime, callback); }
private IEnumerator <float> YakuListCoroutine(PointInfo point, int totalPoints, bool richi, UnityAction callback) { yield return(Timing.WaitUntilDone( Timing.RunCoroutine(PointInfoManager.SetPointInfo(point, totalPoints, richi)))); yield return(Timing.WaitForSeconds(MahjongConstants.SummaryPanelDelayTime)); YakuRankManager.ShowYakuRank(point); ConfirmCountDownController.StartCountDown(MahjongConstants.SummaryPanelWaitingTime, callback); }
public void SetTransfer(ClientRoundStatus CurrentRoundStatus, int[] places, IList <PointTransfer> transfers, UnityAction callback) { gameObject.SetActive(true); var points = CurrentRoundStatus.Points; for (int placeIndex = 0; placeIndex < SubManagers.Length; placeIndex++) { int playerIndex = CurrentRoundStatus.GetPlayerIndex(placeIndex); if (!IsValidPlayer(playerIndex, CurrentRoundStatus.TotalPlayers)) { continue; } // get corresponding transfers var localTransfers = new List <Transfer>(); foreach (var transfer in transfers) { if (transfer.From == playerIndex) { localTransfers.Add(new Transfer { Type = GetTransferType(transfer.From, transfer.To), Amount = -transfer.Amount }); } if (transfer.To == playerIndex) { localTransfers.Add(new Transfer { Type = Type.None, Amount = transfer.Amount }); } } SubManagers[placeIndex].SetTransfers(points[placeIndex], localTransfers); var place = System.Array.Find(places, p => p == playerIndex); SubManagers[placeIndex].SetPlace(place); } Timing.RunCoroutine(ShowPlacesAnimation(CurrentRoundStatus, places)); // count down ConfirmButton.onClick.RemoveAllListeners(); ConfirmButton.onClick.AddListener(() => { ConfirmCountDownController.StopCountDown(); callback(); }); ConfirmCountDownController.StartCountDown(MahjongConstants.SummaryPanelWaitingTime, callback); }
private void Start() { dayNightController.GetActualTime += SetTimeJson; LoadData(); dayNightController.StartTime(timeJSON); Instantiate(Interface); countdownController = GameObject.FindWithTag("CountDown").GetComponent <CountDownController>(); countdownController.secondsLeft = totalSecondsGame; countdownController.StartCountDown(); countdownController.OnCountdownOver += OnCountDownDone; if (OnGameStart != null) { OnGameStart(); } }