Add Basic Enemy prefab and Chaser AI; update enemy spawn settings and projectile speed

This commit is contained in:
2025-07-12 14:25:46 +02:00
parent c59baf2f3a
commit 56592fa7ad
8 changed files with 688 additions and 5 deletions

View File

@@ -0,0 +1,39 @@
using System;
using Data;
using KBCore.Refs;
using Pathfinding;
using Systems;
using UnityEngine;
namespace AI
{
public class Chaser : MonoBehaviour
{
[SerializeField, Self] private Character character;
[SerializeField, Self] private AIPath aiPath;
[SerializeField] private Transform target;
private void OnEnable()
{
SetTarget();
}
private void Start()
{
SetTarget();
}
private void Update()
{
if (!target || !aiPath) return;
aiPath.maxSpeed = character.attributes.MoveSpeed;
aiPath.destination = target.position;
}
private void SetTarget()
{
target = GameManager.Instance.Player.transform;
}
}
}