using System.Collections.Generic; using UnityEngine; public class MobUpdateManager : MonoBehaviour { public static MobUpdateManager Instance; // ⭐ Monster -> MonsterClass로 수정하여 에러 해결 private List _activeMobs = new List(); private void Awake() => Instance = this; // ⭐ 매개변수 타입도 MonsterClass로 변경 public void RegisterMob(MonsterClass mob) => _activeMobs.Add(mob); public void UnregisterMob(MonsterClass mob) => _activeMobs.Remove(mob); private void Update() { for (int i = 0; i < _activeMobs.Count; i++) { // 리스트를 돌며 카메라 최적화 로직이 담긴 OnManagedUpdate 호출 if (_activeMobs[i] != null) _activeMobs[i].OnManagedUpdate(); } } }