public void TurnOffHouse(char house) { switch (house) { case 'A': ALight.SetActive(false); A = false; break; case 'B': BLight.SetActive(false); B = false; break; case 'C': CLight.SetActive(false); C = false; break; default: break; } }
void Update() { char c = (char)serial.ReadChar(); Debug.Log(c); if (serial.IsOpen) { if (!A && c == 'A') { ALight.SetActive(true); A = true; } if (!B && c == 'B') { BLight.SetActive(true); B = true; } if (!C && c == 'C') { CLight.SetActive(true); C = true; } } }