public void OnStartClient() { SyncPivot(pivot, pivot); SyncInitialPosition(initialPosition, initialPosition); MatrixMoveNewPlayer.Send(networkedMatrix.MatrixSync.netId); clientStarted = true; }
IEnumerator WaitForMatrixManager() { while (!MatrixManager.IsInitialized) { yield return(WaitFor.EndOfFrame); } yield return(WaitFor.EndOfFrame); if (isServer) { InitServerState(); MatrixMoveEvents.OnStartMovementServer.AddListener(() => { if (floatingSyncHandle == null) { this.StartCoroutine(FloatingAwarenessSync(), ref floatingSyncHandle); } }); MatrixMoveEvents.OnStopMovementServer.AddListener(() => this.TryStopCoroutine(ref floatingSyncHandle)); NotifyPlayers(); } else { SyncPivot(pivot, pivot); SyncInitialPosition(initialPosition, initialPosition); MatrixMoveNewPlayer.Send(netId); clientStarted = true; } }
IEnumerator WaitForMatrixManager() { while (!MatrixManager.IsInitialized) { yield return(WaitFor.EndOfFrame); } yield return(WaitFor.EndOfFrame); if (CustomNetworkManager.IsServer) { InitServerState(); MatrixMoveEvents.OnStartMovementServer.AddListener(() => { if (floatingSyncHandle == null) { this.StartCoroutine(FloatingAwarenessSync(), ref floatingSyncHandle); } }); MatrixMoveEvents.OnStopMovementServer.AddListener(() => this.TryStopCoroutine(ref floatingSyncHandle)); NotifyPlayers(); } else { SyncPivot(pivot, pivot); SyncInitialPosition(initialPosition, initialPosition); MatrixMoveNewPlayer.Send(networkedMatrix.MatrixSync.netId); clientStarted = true; var child = transform.GetChild(0); matrixInfo = MatrixManager.Get(child.gameObject); } }
public static MatrixMoveNewPlayer Send(uint matrixMoveNetId) { MatrixMoveNewPlayer msg = new MatrixMoveNewPlayer { MatrixMove = matrixMoveNetId }; msg.Send(); return(msg); }