private void Start() { localPlayer = Instantiate <VRLocalPlayer>(pfLocalPlayer, Vector3.zero, Quaternion.identity); var pIdx = JooConfiguration.GetConfig <NetworkPlayer>().playerIndex; localPlayer.InitializePlayer(pIdx, spawnPoints[pIdx].position); }
private IEnumerator Start() { yield return(null); RegisterSocket(socket); socket.Connect(); yield return(new WaitForSeconds(0.5f)); var jsonStr = JsonConvert.SerializeObject(JooConfiguration.GetConfig <NetworkPlayer>()); socket.Emit("playerEnter", JSONObject.Create(jsonStr)); }
private void OnPlayerEnter(NetworkPlayer[] players) { foreach (var p in players) { bool hasConnected = dicPlayer.ContainsKey(p.playerIndex); if (!hasConnected && p.playerIndex != JooConfiguration.GetConfig <NetworkPlayer>().playerIndex) { VRRemotePlayer tLocalPlayer = Instantiate <VRRemotePlayer>(pfRemotePlayer, Vector3.zero, Quaternion.identity); tLocalPlayer.InitializePlayer(p.playerIndex, spawnPoints[p.playerIndex].position); dicPlayer.Add(p.playerIndex, tLocalPlayer); } } }