Files
Northbound/Assets/Scripts/EnemyPortal.cs
dal4segno ada6aae8bc 몬스터 이동 AI
- 코어로의 경로가 막혀있을 경우 장애물을 파괴하여 경로 확보

몬스터를 소환하는 EnemyPortal 생성
2026-01-29 14:39:10 +09:00

36 lines
884 B
C#

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<GameObject> 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);
enemy.GetComponent<NetworkObject>().Spawn();
Debug.Log(enemy);
}
}
// Update is called once per frame
void Update()
{
}
}