diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 13cf274..bd4bb0d 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -11851,6 +11851,7 @@ GameObject: - component: {fileID: 1529264662} - component: {fileID: 1529264661} - component: {fileID: 1529264660} + - component: {fileID: 1529264665} m_Layer: 0 m_Name: MainCamera m_TagString: MainCamera @@ -12010,6 +12011,29 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1529264665 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1529264659} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8a592fac78e06964b863b67047a446a1, type: 3} + m_Name: + m_EditorClassIdentifier: + Wave: 0 + difficulty: 1 + difficultyIncreasePerWave: 0.75 + WaveTime: 5 + enemyDifficulties: [] + SpawnRadius: 17.8 + NumEnemies: 6 + players: + - {fileID: 1254139629} + - {fileID: 1579580564} + enemyList: [] --- !u!1 &1530488094 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Controller/EnemySpawner/EnemySpawner.cs b/Assets/Scripts/Controller/EnemySpawner/EnemySpawner.cs index 8d4dd3f..d3c8bcf 100644 --- a/Assets/Scripts/Controller/EnemySpawner/EnemySpawner.cs +++ b/Assets/Scripts/Controller/EnemySpawner/EnemySpawner.cs @@ -20,6 +20,7 @@ public class NewBehaviourScript : MonoBehaviour [SerializeField] private List enemyDifficulties; [SerializeField] private float SpawnRadius = 10; [SerializeField] private int NumEnemies = 6; + [SerializeField] private GameObject[] players; // Private private bool nextWaveRequested = false; @@ -84,6 +85,8 @@ public class NewBehaviourScript : MonoBehaviour { GameObject enemy = Instantiate(decendingList[i].prefabs[UnityEngine.Random.Range(0, decendingList[i].prefabs.Length)], GetRandomPointOnCircle(mainCam.transform.position, SpawnRadius), Quaternion.identity, SpawnedEnenmyHolder.transform); difficulty -= decendingList[i].Difficulty; + + enemy.GetComponent().targets = players.Select(x=>x.transform).ToArray(); } } } @@ -96,6 +99,8 @@ public class NewBehaviourScript : MonoBehaviour var enemyToSpawn = validEnemies[UnityEngine.Random.Range(0, validEnemies.Length)]; difficulty -= enemyToSpawn.Difficulty; GameObject enemy = Instantiate(enemyToSpawn.prefabs[UnityEngine.Random.Range(0, enemyToSpawn.prefabs.Length)], GetRandomPointOnCircle(mainCam.transform.position, SpawnRadius), Quaternion.identity, SpawnedEnenmyHolder.transform); + + enemy.GetComponent().targets = players.Select(x => x.transform).ToArray(); } } diff --git a/Assets/Scripts/Enemy/EnemyPathFinding.cs b/Assets/Scripts/Enemy/EnemyPathFinding.cs index 329d07a..89e318a 100644 --- a/Assets/Scripts/Enemy/EnemyPathFinding.cs +++ b/Assets/Scripts/Enemy/EnemyPathFinding.cs @@ -6,7 +6,7 @@ using UnityEngine.AI; public class EnemyPathFinding : MonoBehaviour { - [SerializeField] private Transform[] targets; + [SerializeField] public Transform[] targets; [SerializeField] private float ropeDistCheck = 1f; [SerializeField] private LayerMask ropeCheckMask; diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index 8d07924..c68cac4 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -169,8 +169,8 @@ InputManager: m_Name: bruh_v descriptiveName: descriptiveNegativeName: - negativeButton: - positiveButton: + negativeButton: w + positiveButton: s altNegativeButton: altPositiveButton: gravity: 0