public void OnCollisionEnter(Collision col) { if (explodeOnContact) { Damagable dam = col.gameObject.GetComponent <Damagable>(); if (dam) { onHitTarget(dam); } if (aoe != -1) { damageArea(transform.position, aoe); } { removeMe(); } } }
public void Start() { m_controller = gameObject.GetComponentInChildren <CharacterController>(); m_guns = gameObject.GetComponentsInChildren <Weapon>(); m_damagable = gameObject.GetComponent <Damagable>(); }
public virtual void Start() { m_damagable = transform.GetComponent <Damagable>(); }