Ejemplo n.º 1
0
 public void TakeDamage(float damage)
 {
     enemies_killed++;
     Debug.Log("Damage Caused: " + damage);
     Destroy(gameObject);
     tankController.ApplyDamage(damage);
 }
Ejemplo n.º 2
0
    private void OnCollisionEnter(Collision col)
    {
        TankController tank = col.collider.GetComponentInParent <TankController>();

        if (tank != null && tank != Owner)
        {
            tank.ApplyDamage(Damage);
        }

        if (tank == Owner)
        {
            return;
        }

        var instance = Instantiate(deathParticles, transform.position, Quaternion.identity);

        Destroy(instance, 3f);

        Destroy(gameObject);
    }
Ejemplo n.º 3
0
 public void TakeDamage(BulletType bulletType, int damage)
 {
     Debug.Log("Taking damage: " + damage + "from bullet: " + bulletType);
     tankController.ApplyDamage(bulletType, damage);
 }
Ejemplo n.º 4
0
    // Update is called once per frame

    public void TakeDamage(float damage)
    {
        tankController.ApplyDamage(damage);
    }