public void Construct( IHealth health, IDamageable damageable, IRespawner <CharacterSpawnParameters> respawner, IItemContainer itemContainer, IWeapon weapon, Rigidbody2D rb) { _health = health; _damageable = damageable; _respawner = respawner; Inventory = itemContainer; Weapon = weapon; _rb = rb; }
void OnTriggerEnter(Collider other) { Health health = other.GetComponentInParent <Health>(); if (health != null) { health.TakeDamage(amountOfDamage); } IRespawner respawner = other.GetComponentInParent <IRespawner>(); if (respawner != null) { respawner.Respawn(respawnPlace); } }
public void Construct(IRespawner <PickupSpawnParameters> respawner) { _respawner = respawner; }