Add Advanced and Elite Enemy prefabs; adjust attributes and implement projectile behavior

This commit is contained in:
2025-07-12 22:38:21 +02:00
parent e3e58f89cb
commit 6511a5586e
16 changed files with 1438 additions and 134 deletions

View File

@@ -33,6 +33,8 @@ namespace AI
private void SetTarget()
{
if (!GameManager.Instance.Player) return;
target = GameManager.Instance.Player.transform;
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using Inventory;
using Systems;
@@ -13,6 +14,7 @@ namespace Shop
[SerializeField] private Transform weaponSlotParent;
[SerializeField] private ShopSlotUI slotPrefab;
[SerializeField] private TextMeshProUGUI roundsText;
[SerializeField] private TextMeshProUGUI coinsText;
private List<ShopSlotUI> currentSlots = new();
@@ -26,6 +28,11 @@ namespace Shop
GameManager.Instance.OnRoundEnd -= UpdateRoundText;
}
private void Update()
{
coinsText.text = $"Coins: {GameManager.Instance.Coins}";
}
public void Show(List<StatModifierItem> items, List<WeaponItem> weapons, ShopManager shopManager)
{
GameManager.Instance.StoreIsClosed = false;

View File

@@ -19,6 +19,11 @@ namespace Systems
private void Update()
{
if (!target)
{
AquirePlayerTarget();
}
if (!target || weapons.Count == 0) return;
foreach (var weapon in weapons)
@@ -26,5 +31,11 @@ namespace Systems
weapon.Target = target.position;
}
}
private void AquirePlayerTarget()
{
var player = GameManager.Instance.Player;
target = player ? player.transform : null;
}
}
}

View File

@@ -37,7 +37,7 @@ namespace Systems
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
// DontDestroyOnLoad(gameObject);
}
else
{