Refactor player and enemy scripts; remove unused classes and improve initialization

- Added base initialization call in PlayerController.
- Changed player reference in EnemyAI to be serialized for better inspector visibility.
- Ensured characters are initialized upon spawning in EnemySpawner.
- Removed obsolete EnemyAI and Chest scripts to streamline codebase.
- Added KeyChest script for key collection functionality.
- Introduced new meta files for better organization and tracking.
- Created launch configuration for Unity debugging.
This commit is contained in:
2026-06-20 18:39:30 +03:00
parent 39e4e51866
commit ad6388f330
41 changed files with 200 additions and 786 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ public class EnemyAI : Character
private float _stunTimer = 0f;
private float _patrolDirection = 1f;
private static readonly Player _player = null;
[SerializeField] private Character _player = null;
public EnemyState CurrentState => _currentState;
@@ -58,7 +58,7 @@ public class EnemyAI : Character
}
// Get player position if available
var player = Player.Instance;
var player = _player;
if (player == null)
{
HandlePatrol();