Fix some bugs

This commit is contained in:
WillJeynes
2026-08-28 22:02:44 +01:00
parent 63b2798432
commit 44c59c425c
22 changed files with 596 additions and 29 deletions
+6 -1
View File
@@ -91,7 +91,12 @@ public class LevelLoader : Singleton<LevelLoader>
for(int i = 0; i < data.guards.Count; i++)
{
var guardinstance = Instantiate(GuardPrefabs.ByKey(data.guards[i].type));
guardinstance.transform.position = new Vector3(spacingGuards*(i+1), 0, -5);
//its late, i cant think straight
var offset = i == data.guards.Count - 1 ? -2 : 2;
offset = data.guards.Count == 1 ? 0 : offset;
guardinstance.transform.position = new Vector3(spacingGuards*(i+1)+offset, 0, -5);
var manager = guardinstance.GetComponent<GuardManager>();
manager.type = data.guards[i].action;