Add new 2 levels. Add batteries models for the puzzle. Level finish logic. Door openning. And some other changes

This commit is contained in:
Emil Shanaty
2025-04-27 23:46:11 +03:00
parent 6737be11fc
commit bf8b7c5457
47 changed files with 7901 additions and 3515 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Serialization;
[RequireComponent(typeof(NavMeshAgent))]
[RequireComponent(typeof(HealthManager))]
@@ -9,7 +10,7 @@ public class EnemyAI : MonoBehaviour
private HealthManager health;
private Renderer rend;
private Transform playerTransform;
[FormerlySerializedAs("correspondingLevelManager")] public LevelManager levelManager;
void Awake()
{
agent = GetComponent<NavMeshAgent>();
@@ -21,6 +22,7 @@ public class EnemyAI : MonoBehaviour
var playerCol = GameObject.FindWithTag("Player").GetComponent<Collider>();
var selfCol = GetComponent<Collider>();
Physics.IgnoreCollision(playerCol, selfCol);
levelManager.AddEnemyToList(gameObject);
}
void Start()
@@ -35,6 +37,8 @@ public class EnemyAI : MonoBehaviour
{
agent.speed = Random.Range(2, 10);
}
}
void Update()
@@ -57,6 +61,7 @@ public class EnemyAI : MonoBehaviour
{
if (agent != null)
agent.isStopped = true;
levelManager.RemoveEnemyFromList(gameObject);
Destroy(gameObject);
}
}