DI 추가
This commit is contained in:
21
Assets/Sample/Injector/InjectorSampleEnemySpawner.cs
Normal file
21
Assets/Sample/Injector/InjectorSampleEnemySpawner.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UVC.Core;
|
||||
|
||||
namespace Sample
|
||||
{
|
||||
/// <summary>
|
||||
/// Type B: MonoBehaviour - Scene 라이프사이클
|
||||
/// 씬 전환 시 자동 파괴됨
|
||||
/// </summary>
|
||||
public class InjectorSampleEnemySpawner : MonoBehaviour, IEnemySpawner
|
||||
{
|
||||
[Inject] private ILogService _logger;
|
||||
public int EnemyCount { get; private set; }
|
||||
|
||||
public void SpawnEnemy(Vector3 position)
|
||||
{
|
||||
EnemyCount++;
|
||||
_logger?.Log($"Enemy spawned at {position}. Total: {EnemyCount}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user