void Burn(IBurnable b) { if (b == null) { return; } b.Burn(this); }
void OnCollisionEnter(Collision collision) { m_burnableObject = collision.transform.GetComponent <IBurnable>(); if (m_burnableObject != null) { m_burnableObject.Burn(); m_burnableObject = null; } }
void OnTriggerEnter(Collider other) { m_burnableObject = other.GetComponent <IBurnable>(); if (m_burnableObject != null) { m_burnableObject.Burn(); m_burnableObject = null; } GameObject.Destroy(gameObject); }