IEnumerator WaitUnlock() { yield return(new WaitForSeconds(UnlockWaitTime)); if (m_animation && !string.IsNullOrEmpty(unlockAnimation)) { if (!isPlayed) { if (UnlockSound) { AudioSource.PlayClipAtPoint(UnlockSound, transform.position, 0.75f); } m_animation.wrapMode = WrapMode.Once; m_animation.Play(unlockAnimation); isPlayed = true; } yield return(new WaitUntil(() => !m_animation.isPlaying)); yield return(new WaitForSeconds(0.5f)); } foreach (var digit in GetComponentsInChildren <NumberPadlockDigits>()) { digit.isUsable = false; } UnlockEvent.Invoke(); examineManager.CancelExamine(); isUnlocked = true; }