public static void SetActive(string name, bool state, bool only) { bool check = false; for (int i = 0; i < multiCanvas.Count; i++) { if (name == names[i]) { multiCanvas[i].SetActive(true); multiCanvas[i].SendMessage("SetActive", state); check = true; if (!only) { return; } } else if (only && multiCanvas[i].active) { multiCanvas[i].SendMessage("SetActive", false); } } if (check) { return; } double closest = 0; int index = 0; for (int i = 0; i < multiCanvas.Count; i++) { double cur = StringSimilarity.CalculateSimilarity(name, names[i]); if (cur > closest) { closest = cur; index = i; } } if (closest == 0) { Debug.LogError("UILib could not find menu by name : " + name); } else { Debug.LogError("UILib could not find menu by name : " + name + ", did you think : " + names[index]); } }