コード例 #1
0
ファイル: EnemyModel.cs プロジェクト: kev-miles/AlienMatchers
    void TerminateNeighbours(int multiplier)
    {
        if (_enemyTop != null)
        {
            if (_enemyBot != null)
            {
                _enemyTop._enemyBot = this._enemyBot;
            }
            else
            {
                _enemyTop._enemyBot = null;
            }

            if (_enemyTop.tint == this.tint)
            {
                _enemyTop.Death(multiplier);
            }
        }

        if (_enemyBot != null)
        {
            _enemyBot._enemyTop = null;

            if (_enemyBot.tint == this.tint)
            {
                _enemyBot.Death(multiplier);
            }
        }

        if (_enemyLeft != null)
        {
            _enemyLeft._enemyRight = null;

            if (_enemyLeft.tint == this.tint)
            {
                _enemyLeft.Death(multiplier);
            }
        }

        if (_enemyRight != null)
        {
            _enemyRight._enemyLeft = null;

            if (_enemyRight.tint == this.tint)
            {
                _enemyRight.Death(multiplier);
            }
        }
    }