diff --git a/Police Station Simulator/Assets/CitizenBehaviour.cs b/Police Station Simulator/Assets/CitizenBehaviour.cs index 1885e38..4ab5387 100644 --- a/Police Station Simulator/Assets/CitizenBehaviour.cs +++ b/Police Station Simulator/Assets/CitizenBehaviour.cs @@ -45,7 +45,6 @@ void Update () move.target = GameObject.Find("Exit"); follow_path.calcPath(move.target.transform); action = true; - //Instantiate(level.citizens[Random.Range(0, level.citizens.Length - 1)], GameObject.Find("Entrance").transform.position,Quaternion.Euler(0,90,0)); } return; diff --git a/Police Station Simulator/Assets/CriminalBehavior.cs b/Police Station Simulator/Assets/CriminalBehavior.cs index 464aab9..fe02d1c 100644 --- a/Police Station Simulator/Assets/CriminalBehavior.cs +++ b/Police Station Simulator/Assets/CriminalBehavior.cs @@ -60,7 +60,7 @@ void Update() } } - // Changes the Animtor booleans + // Changes the Animator booleans if (move.move == true) { anim.SetBool("moving", true); diff --git a/Police Station Simulator/Assets/LevelLoop.cs b/Police Station Simulator/Assets/LevelLoop.cs index da6f09d..833522e 100644 --- a/Police Station Simulator/Assets/LevelLoop.cs +++ b/Police Station Simulator/Assets/LevelLoop.cs @@ -40,6 +40,7 @@ void Update() { if (day) { + //Spawn Entites evey x time if (cycle - timer1 > 15) { timer1 = cycle; @@ -57,11 +58,7 @@ void Update() } if (!actions) { - //foreach (GameObject go in citizens) - //{ - // if (go != null) - // go.GetComponent().Day(); - //} + //Change the behaviour to Day foreach (GameObject go in policemen) { if (go != null) @@ -71,11 +68,6 @@ void Update() GameObject ob = Instantiate(policemen_prebab[Random.Range(0, policemen_prebab.Length - 1)], GameObject.Find("Entrance").transform.position, Quaternion.Euler(0, 90, 0)); ob.GetComponent().behaviour = PoliceBehaviour.TypeAction.Receptionist; policemen.Add(ob); - //foreach (GameObject go in criminals) - //{ - // if (go != null) - // go.GetComponent().Day(); - //} timer1 = 0; timer2 = -15; @@ -88,7 +80,7 @@ void Update() else if(!actions && !day) { patrol = 0; - + //Change the behavior of all entities to Night foreach (GameObject go in citizens) { if (go != null) @@ -110,6 +102,7 @@ void Update() cycle += Time.deltaTime; + //Resets the counter to show all possible agents if (c1 == citizens_prebab.Length) c1 = 0; if (c2 == policemen_prebab.Length) @@ -117,6 +110,7 @@ void Update() if (c3 == criminals_prebab.Length) c3 = 0; + //Changes the cycle of day and night if (cycle >= 120) { day = !day;