void OnCollisionEnter2D(Collision2D collision) { if (IsBreakable() && (++timesHit >= maxHits)) { Destroy(gameObject); GameObject smokePuff = Instantiate(smoke, new Vector3(transform.position.x, transform.position.y, -10f), Quaternion.identity); var main = smokePuff.GetComponent <ParticleSystem>().main; Debug.Log(brickColor); Debug.Log("Red: " + Color.red); main.startColor = brickColor; levelManager.brickCount--; levelManager.CheckBrickCount(); } }