Exemple #1
0
 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;
 }
Exemple #2
0
    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);
        }
    }
Exemple #3
0
 public void Construct(IRespawner <PickupSpawnParameters> respawner)
 {
     _respawner = respawner;
 }