Exemple #1
0
        private IEnumerator StartProductionTimer()
        {
            var currentProductionCell = Production.Cells[_productionObject.Index];
            var productionTime        = DateUtil.GetTime(_productionObject.TimeEnd);

            if (productionTime == 0)
            {
                yield return(new WaitForSeconds(0.1f));

                currentProductionCell.SetStateFinish();
                yield break;
            }

            while (productionTime > 0)
            {
                currentProductionCell.SetCellTimer(DateUtil.DateCraftTimer(productionTime));
                yield return(new WaitForSeconds(1.0f));

                productionTime--;
            }

            currentProductionCell.SetStateFinish();
        }