private void Demolish(GameObject gameObject) { ElectricNetworkConnector electricNetworkConnector = gameObject.GetComponent <ElectricNetworkConnector>(); if (electricNetworkConnector != null) { electricNetworkConnector.HandleDemolishingBy(PlayerManager.electricNetworkManager); return; } Destroy(gameObject); }