public void SetNumberInCell() { Cell[] cells = FindObjectsOfType <Cell>(); foreach (Cell targetCell in cells) { if (targetCell.selected == true && targetCell.storedNumber != _number && targetCell.storedNumber != targetCell.trueStoredNumber) { ChangeMemoryManager changeMemoryManager = FindObjectOfType <ChangeMemoryManager>(); changeMemoryManager.AddChange(targetCell, targetCell.storedNumber); targetCell.SetStorageNumber(_number); targetCell.ChangeStoredNumberTextColor(); if (targetCell.storedNumber == targetCell.trueStoredNumber) { GameManager.Score += GetPoints(); } } } CheckNumberInCells(); AudioSource audioSource = GameObject.Find("Audio Point").GetComponent <AudioSource>(); audioSource.clip = _soundFX; audioSource.Play(); }
private void Start() { _changeMemoryManager = FindObjectOfType <ChangeMemoryManager>(); }