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

3
Assets/Scripts/AI.meta Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fd150948bb694852a35cf1413b7bde52
timeCreated: 1752320960

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;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 032c4d53d6b340fc994192cc0d24a061
timeCreated: 1752320968