예제 #1
0
    public void updatePosition()
    {
        TilemapHandler.clearBall();
        tilePosition = TilemapHandler.getTileAtPosition(transform.position);
        TilemapHandler.getTile(tilePosition).setHasBall(true);

        if (enemyGoal.GetComponent <Collider2D>().OverlapPoint(transform.position))
        {
            Score.playerScore++;
            TilemapHandler.reset();
        }

        if (ownGoal.GetComponent <Collider2D>().OverlapPoint(transform.position))
        {
            Score.enemyScore++;
            TilemapHandler.reset();
        }
    }