IEnumerator WaitForConnect() { if (ExampleManager.Instance.CurrentUser != null && !IsMine) { yield break; } while (!ExampleManager.Instance.IsInRoom) { yield return(0); } LSLog.LogImportant("HAS JOINED ROOM - CREATING ENTITY"); ExampleManager.CreateNetworkedEntityWithTransform(new Vector3(0f, 0f, 0f), Quaternion.identity, new Dictionary <string, object>() { ["prefab"] = "VMEViewPrefab" }, this, (entity) => { LSLog.LogImportant($"Network Entity Ready {entity.id}"); }); }
private IEnumerator WaitForConnect() { if (ExampleManager.Instance.CurrentUser != null && !IsMine) { yield break; } lookCamera.gameObject.SetActive(true); while (!ExampleManager.Instance.IsInRoom) { yield return(0); } LSLog.LogImportant("HAS JOINED ROOM - CREATING ENTITY"); ExampleManager.CreateNetworkedEntityWithTransform(transform.position, Quaternion.identity, new Dictionary <string, object> { ["userName"] = ExampleManager.Instance.UserName }, this, entity => { userName = ExampleManager.Instance.UserName; userNameDisplay.text = userName; ExampleManager.Instance.CurrentNetworkedEntity = entity; }); }