コード例 #1
0
    private async Task DestroyBall(BallView ballView)
    {
        //Check for resource
        if (ballView.resourceConfig != null)
        {
            switch (ballView.resourceConfig.id)
            {
            case 0:
            {
                wood++;
            }
            break;

            case 1:
            {
                stones++;
            }
            break;

            case 2:
            {
                water++;
            }
            break;
            }
        }


        await ballView.Explode();

        ballView.onMouseDown -= OnBallClicked;
        ballViews.Remove(ballView);
        ballView.Dispose();
    }