private void OnDestroy() { if (m_CurrentSmokeDetector != null) { m_CurrentSmokeDetector.DetectingSmoke(false); m_CurrentSmokeDetector = null; } }
private void OnTriggerEnter(Collider other) { if (other.tag == "SmokeDetector") { m_CurrentSmokeDetector = other.GetComponent <SmokeDetector>(); m_CurrentSmokeDetector.DetectingSmoke(true); } }