public ObjectCategory GetHighestObjectCategory() { ObjectCategory max = categories[0]; foreach (ObjectCategory e in categories) { if (e.score > max.score) { max = e; } } Debug.Log("Best ObjectCategory Guess: " + max.ToString()); txt.text = max.ToString(); return(max); }
public List <ObjectCategory> ConvertScoresToCategoryList(JSONObject cat) { List <ObjectCategory> visionGuesses = new List <ObjectCategory>(); for (int i = 0; i < cat.Count; i++) { JSONObject lineObj = cat[i]; ObjectCategory c = new ObjectCategory(lineObj.list[0].ToString(), float.Parse(lineObj.list[1].ToString())); visionGuesses.Add(c); Debug.Log(c.ToString()); } return(visionGuesses); }