private void Awake() { if (instace != null) { Destroy(gameObject); } else { instace = this; } }
void Awake() { /*if (bricksPool == null) * { * bricksPool = transform.parent; * } * if (bricksPool == null) * { * Debug.LogError("[Brick] Either Brick's pool is not assigned OR Brick is not set as a child of a pool!"); * }*/ destroyEffect = GetComponent <BrickDestroyEffect>(); dropper = GetComponent <BrickDropper>(); }