public void SelectProtocol(int id) { if (!clicked) { if (!selectedProtocol) { foreach (ProtocolUI p in protocolList) { if (p.id != id) { p.Deselected(); Debug.Log("deselected"); } else { selectedProtocol = p; clicked = true; p.Selected(); } } } } else { if (selectedProtocol && selectedProtocol.id == id) { ResetButtons(); selectedProtocol = null; clicked = false; } } }
public void ResetButtons() { foreach (ProtocolUI p in protocolList) { p.ResetUI(); } clicked = false; selectedProtocol = null; }