public void LocalizedHit(LocalizedHitData data) { BuildingHealth buildingHealth = this.GetBuildingHealth(); if (buildingHealth) { buildingHealth.LocalizedHit(data); } }
public void LocalizedHit(LocalizedHitData data) { PrefabIdentifier componentInParent = base.transform.GetComponentInParent <PrefabIdentifier>(); if (componentInParent) { BuildingHealth component = componentInParent.GetComponent <BuildingHealth>(); if (component) { component.LocalizedHit(data); } } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag(this._tag)) { BuildingHealth componentInParent = base.transform.GetComponentInParent <BuildingHealth>(); if (componentInParent) { componentInParent.LocalizedHit(new LocalizedHitData { _position = other.transform.position, _damage = (float)this._damage }); } } }
public IEnumerator OnExplode(Explode.Data explodeData) { if (!this._exploding && !PlayerPreferences.NoDestruction) { this._exploding = true; if (!BoltNetwork.isClient) { BuildingHealth component = base.GetComponent <BuildingHealth>(); if (component) { component.LocalizedHit(new LocalizedHitData { _damage = explodeData.explode.damage * this.GetDamageRatio(explodeData.distance, explodeData.explode.radius), _position = explodeData.explode.transform.position, _distortRatio = 1.35f }); } } else { FoundationHealth component2 = base.GetComponent <FoundationHealth>(); if (component2) { component2.Distort(new LocalizedHitData { _damage = explodeData.explode.damage * this.GetDamageRatio(explodeData.distance, explodeData.explode.radius), _position = explodeData.explode.transform.position, _distortRatio = 2.5f }); } } yield return(null); this._exploding = false; } yield break; }