using Northbound; using System.Collections.Generic; using Unity.Netcode; using UnityEngine; using static Northbound.ObstacleSpawner; using static UnityEditor.FilePathAttribute; public class EnemyPortal : MonoBehaviour { [Header("Spawn Settings")] [Tooltip("소환할 몬스터 목록")] [SerializeField] private List Enemies = new(); // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { GlobalTimer.Instance.OnCycleComplete += SpawnEnemy; } private void SpawnEnemy() { foreach (GameObject obj in Enemies) { GameObject enemy = Instantiate(obj, transform); // Add FogOfWarVisibility component to hide enemies in unexplored areas if (enemy.GetComponent() == null) { var visibility = enemy.AddComponent(); visibility.showInExploredAreas = false; // Enemies hidden when not visible visibility.updateInterval = 0.2f; } enemy.GetComponent().Spawn(); Debug.Log(enemy); } } // Update is called once per frame void Update() { } }