Esempio n. 1
0
        public void RevealCell(Cell cell, int x, int y, bool animated = true)
        {
            var datum = new RevealAnimationDatum(cell, x, y);

            if (animated)
            {
                _revealSequence.AddAnimation(datum);
            }
            else
            {
                PlayRevealAnimation(datum);
            }
        }
Esempio n. 2
0
        private void PlayRevealAnimation(RevealAnimationDatum datum)
        {
            CellView cellView = _cellViews[datum.x, datum.y];

            cellView.SetState(CellAnimatorHelper.State.InReveal);

            if (datum.cell.value != 0)
            {
                if (datum.cell.hasMine)
                {
                    cellView.mineSprite.enabled = true;
                    cellView.textMesh.enabled   = false;
                }
                else
                {
                    cellView.textMesh.text    = datum.cell.value.ToString();
                    cellView.textMesh.color   = colorSheet.GetColorForCellValue(datum.cell.value);
                    cellView.textMesh.enabled = true;
                }
            }

            cellView.backgroundSprite.color = colorSheet.revealedCellColor;
        }