public void SetTarget(GameObject go) { //hitTarget = go; if (go) target = go.GetComponent<iDamage>(); else target = null; }
public void init(float burnDurration, float burnRate, float damage, int id) { du = GetComponent<iDamage>(); burnTime = burnDurration; burnerId = id; this.damage = damage; this.burnRate = burnRate; lastBurn = -burnRate; }
private void OnCollisionEnter2D(Collision2D collision) { iDamage damagable = collision.transform.GetComponent <iDamage>(); if (damagable != null) { damagable.Damage(-1); } if (explosion != null) { explosion.transform.parent = null; explosion.Play(); } Destroy(gameObject); }
// Use this for initialization void Start() { du = GetComponent<iDamage>(); }