public void OnPlayerJoins(bool connects, int index, Inputs.ControllerType type) { if (connects) { nbPlayers += 1; connections[index].connect(type); } else { nbPlayers -= 1; connections[index].disconnect(); } waiting.SetActive(nbPlayers != 2); start.SetActive(nbPlayers == 2); }
public ConnectionInfos(KeyCode ak, int ci, Inputs.ControllerType ct) { accessKey = ak; controllerIndex = ci; controllerType = ct; }
public void connect(Inputs.ControllerType type) { img.sprite = type == Inputs.ControllerType.CONTROLLER ? controller : keyboard; disconnected.SetActive(false); connected.SetActive(true); }