Skip to content
Snippets Groups Projects
Commit d1c30375 authored by Rhys Jacob's avatar Rhys Jacob
Browse files

Corroboration fix

parent 5f3c592f
Branches
No related merge requests found
...@@ -9,6 +9,8 @@ public class EvidenceHandler : MonoBehaviour { ...@@ -9,6 +9,8 @@ public class EvidenceHandler : MonoBehaviour {
public List<Evidence> allStatements; public List<Evidence> allStatements;
public List<Evidence> allCorroborations; public List<Evidence> allCorroborations;
public Evidence[] evidenceList;
//Lists to reference all the clues/statements/corroborations that the player has discovered in the current level. //Lists to reference all the clues/statements/corroborations that the player has discovered in the current level.
public List<Evidence> foundClues; public List<Evidence> foundClues;
public List<Evidence> foundStatements; public List<Evidence> foundStatements;
...@@ -21,7 +23,11 @@ public class EvidenceHandler : MonoBehaviour { ...@@ -21,7 +23,11 @@ public class EvidenceHandler : MonoBehaviour {
void Start () void Start ()
{ {
//Object array to hold all of the evidence. //Object array to hold all of the evidence.
Object[] evidenceList = FindObjectsOfType<Evidence>(); evidenceList = FindObjectsOfType<Evidence>();
allClues.Clear();
allStatements.Clear();
allCorroborations.Clear();
//Loops through and pulls references to all the Evidence objects in the level, pushing them into their relevant lists. //Loops through and pulls references to all the Evidence objects in the level, pushing them into their relevant lists.
for (int i = 0; i < evidenceList.Length; i++) for (int i = 0; i < evidenceList.Length; i++)
...@@ -64,9 +70,9 @@ public class EvidenceHandler : MonoBehaviour { ...@@ -64,9 +70,9 @@ public class EvidenceHandler : MonoBehaviour {
List<Evidence> potentialMatches = new List<Evidence>(); List<Evidence> potentialMatches = new List<Evidence>();
//For all corroborations... //For all corroborations...
for (int i = 0; i < allCorroborations.Count; i++) for (int i = allCorroborations.Count - 1; i >= 0; i--)
{ {
//Test if this corroboration's first item id is equal to the first evidence id input. //Test if this corroboration's first item id is equal to the first evidence id input.
if (allCorroborations[i].e1_id == e1.id) if (allCorroborations[i].e1_id == e1.id)
{ {
//If yes, add the item to the list of potential corroborations. //If yes, add the item to the list of potential corroborations.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment