// Editable menus public void EnableEditMenu(GameObject element) { CloseEditMenus(); EditMenu menu = null; if (element == null) { menu = FindEditMenu("AutoPeopleEdit"); menu?.Open(); } else if (element.name == "alg") { menu = FindEditMenu("AlgorithmEdit"); menu?.Open(); } else { switch (element.tag) { case "door": menu = FindEditMenu("DoorEdit"); break; case "tile": menu = FindEditMenu("SectionEdit"); break; case "node": menu = FindEditMenu("NodeEdit"); break; case "edge": menu = FindEditMenu("EdgeEdit"); break; case "person": menu = FindEditMenu("PersonEdit"); break; default: break; } if (menu != null) { menu.Open(); menu.SetEditableElement(element); } } }