factory pattern for zombie error
This commit is contained in:
@@ -10,13 +10,11 @@ namespace Darkmatter.Presentation
|
||||
public class EnemyMotor : MonoBehaviour, IEnemyPawn
|
||||
{
|
||||
[SerializeField] private NavMeshAgent enemyAI;
|
||||
[SerializeField] private Transform playerTransform;
|
||||
[SerializeField] private List<Transform> patrolPoints = new List<Transform>();
|
||||
[Inject] private EnemyConfigSO enemyConfig;
|
||||
|
||||
public Transform PlayerTarget => playerTransform;
|
||||
public Transform PlayerTarget { get; private set; }
|
||||
public NavMeshAgent EnemyAI => enemyAI;
|
||||
public List<Transform> PatrolPoints => patrolPoints;
|
||||
public List<Transform> PatrolPoints { get; private set; } = new List<Transform>();
|
||||
|
||||
public float Health { get; set; } = 100;
|
||||
|
||||
@@ -61,5 +59,10 @@ namespace Darkmatter.Presentation
|
||||
Gizmos.DrawWireSphere(transform.position, enemyConfig.attackRange);
|
||||
}
|
||||
|
||||
public void InitializeFromFactory(Transform player, List<Transform> patrolPoints)
|
||||
{
|
||||
this.PlayerTarget = player;
|
||||
this.PatrolPoints = patrolPoints;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user