public void JoinSession(NetworkDiscoveryWithAnchors.SessionInfo session) { if (session != null && _networkDiscovery.running) { _networkDiscovery.JoinSession(session); } }
public void SetSessionInfo(NetworkDiscoveryWithAnchors.SessionInfo sessionInfo) { if (sessionInfo != null) { gameObject.SetActive(true); SessionInfo = sessionInfo; //FIXME: String Concatenation doesnt work for some reason string buttonString = String.Format("{0}: {1}", SessionInfo.SessionName, SessionInfo.SessionIp); TextGameObject.GetComponent <TextMeshPro>().text = buttonString; } else { SessionInfo = null; gameObject.SetActive(false); } }
public void SetSessionInfo(NetworkDiscoveryWithAnchors.SessionInfo sessionInfo) { SessionInfo = sessionInfo; if (SessionInfo != null) { textMesh.text = string.Format("{0}\n{1}", SessionInfo.SessionName, SessionInfo.SessionIp); if (SessionInfo == scrollingUIController.SelectedSession) { textMaterial.SetColor(textColorId, Color.blue); textMesh.color = Color.blue; } else { textMaterial.SetColor(textColorId, Color.yellow); textMesh.color = Color.yellow; } } }
public void ScrollSessions(int Direction) { int sessionCount = sessionList == null ? 0 : sessionList.Count; SessionIndex = Mathf.Clamp(SessionIndex + Direction, 0, Mathf.Max(0, sessionCount - SessionControls.Length)); for (int index = 0; index < SessionControls.Length; index++) { if (SessionIndex + index < sessionCount) { SessionControls[index].gameObject.SetActive(true); NetworkDiscoveryWithAnchors.SessionInfo sessionInfo = sessionList.Values.ElementAt(SessionIndex + index); SessionControls[index].SetSessionInfo(sessionInfo); } else { SessionControls[index].gameObject.SetActive(false); } } }
public void SetSelectedSession(NetworkDiscoveryWithAnchors.SessionInfo sessionInfo) { SelectedSession = sessionInfo; ScrollSessions(0); }