public void OnTriggerEnter2D(Collider2D other) { DamageInput di = other.gameObject.GetComponent <DamageInput> (); if (di != null) { di.TakeHit(attack); SelfDestruct(); } }
void Awake() { ri = GetComponent <RigidbodyInterface>(); billboard = GetComponentInChildren <Floater> (); damageInput = GetComponentInChildren <DamageInput> (); if (attackTransmitter == null) { attackTransmitter = GetComponentInChildren <AttackTransmitter> (); } damageInput.SetUp(this); attackTransmitter.SetUp(this); }