C# - My increament code is not working?

Hello,

    I am trying make block breaker, in my code I add variable timesHit for record number of times ball hit the block which is increment when ball hit the block but does not show on Unity Editor.

using UnityEngine;
using System.Collections;

public class Brick : MonoBehaviour {

	public int maxHits;
	public int timesHit;

	// Use this for initialization
	void Start () {
		timesHit = 0;
	}
	
	// Update is called once per frame
	void Update () {

	}

	void OnCollisionEnter2D(Collision2D collision){
		timesHit++;
		print (timesHit);
	}
}

The below timesHit++ in OnCollisonEnter2D method is printing correct but timesHit on Unity Editor does increment.!

Hello and welcome to Unity Answers! First it would be helpful if you clean up the formatting of your post to make it a bit easier to read.

As for your question, this works for me exactly as you’ve posted it (Unity 5.2.1f1-64 bit). Are there any other behaviours at play here? Are you sure the brick you are looking at in the inspector is the one printing the timesHit? Have you tried simply closing and reopening Unity? The editor can be janky at times and this indeed can fix some issues.