public override void OnEnter() { UpdateEnemyNames(); m_chest.Y = m_chestStartingY; m_chest.ChestType = 3; if (RoomCompleted) { m_chest.Opacity = 1f; m_chest.Y = m_chestStartingY + 200f; m_chest.IsEmpty = true; m_chest.ForceOpen(); m_chestRevealed = true; using (var enumerator = EnemyList.GetEnumerator()) { while (enumerator.MoveNext()) { var current = enumerator.Current; if (!current.IsKilled) { current.KillSilently(); } } } } else { if (ActiveEnemies == 0) { m_chest.Opacity = 1f; m_chest.Y = m_chestStartingY + 200f; m_chest.IsEmpty = false; m_chest.IsLocked = false; m_chestRevealed = true; } else { m_chest.Opacity = 0f; m_chest.Y = m_chestStartingY; m_chest.IsLocked = true; m_chestRevealed = false; } } if (m_chest.PhysicsMngr == null) { Player.PhysicsMngr.AddObject(m_chest); } base.OnEnter(); }