public void FractureObject() { if (isFractured) { return; } if (fractureSound != null) { print("player"); fractureSound.Play(); } var rb = GetComponent <Rigidbody>(); rb.useGravity = false; rb.isKinematic = true; nonFractured.SetActive(false); fractured.SetActive(true); if (canExplode) { Explode(transform.position); } isFractured = true; //OnFractured?.Invoke(); OnFinancialDamageOccured?.Invoke(GetComponent <Price>().price); Destroy(gameObject, destroyDelay); }
public void TakeFinancialDamage() { var price = GetComponent <Price>(); OnFinancialDamageOccured?.Invoke(price.price); }