public void ExpandRight()
    {
        GameManager.Instance.AdjustCash(-HorizontalUpgradeCost);
        var offset = _frameRect.offsetMax;

        offset.x            += _gridElementSize + _gridSpacing;
        _frameRect.offsetMax = offset;
        _spaces.Expand(ExpandDir.Right);
        _tiles.Expand(ExpandDir.Right);
        _upgradeCounts[(int)ExpandDir.Right]++;
        RepopulateGrid();
    }
예제 #2
0
    public void ExpandRight()
    {
        if (GameManager.Instance.Cash <= HorizontalUpgradeCost)
        {
            GameManager.Instance.PlayAudioClip(GameManager.SoundEffects.ErrorBeep);
            return;
        }
        GameManager.Instance.AdjustCash(-HorizontalUpgradeCost);
        var offset = _frameRect.offsetMax;

        offset.x            += _gridElementSize + _gridSpacing;
        _frameRect.offsetMax = offset;
        _spaces.Expand(ExpandDir.Right);
        _tiles.Expand(ExpandDir.Right);
        _upgradeCounts[(int)ExpandDir.Right]++;
        _upgradeCount++;
        GameManager.Instance.SetNumUpgrades(_upgradeCount);
        GameManager.Instance.PlayAudioClip(GameManager.SoundEffects.MoneyKaching);
        RepopulateGrid();
    }