private static void HandleTeleport(NetworkMessage netMsg) { if (Util.ConnectionIsLocal(netMsg.conn)) { return; } netMsg.ReadMessage <TeleportHelper.TeleportMessage>(TeleportHelper.messageBuffer); if (!TeleportHelper.messageBuffer.gameObject) { return; } bool flag = Util.HasEffectiveAuthority(TeleportHelper.messageBuffer.gameObject); if (flag) { return; } TeleportHelper.TeleportGameObject(TeleportHelper.messageBuffer.gameObject, TeleportHelper.messageBuffer.newPosition, TeleportHelper.messageBuffer.delta, flag); }
// Token: 0x06001AF5 RID: 6901 RVA: 0x0007262C File Offset: 0x0007082C public static void TeleportGameObject(GameObject gameObject, Vector3 newPosition) { bool hasEffectiveAuthority = Util.HasEffectiveAuthority(gameObject); TeleportHelper.TeleportGameObject(gameObject, newPosition, newPosition - gameObject.transform.position, hasEffectiveAuthority); }
// Token: 0x06001AF8 RID: 6904 RVA: 0x00072754 File Offset: 0x00070954 public static void TeleportBody(CharacterBody body, Vector3 targetFootPosition) { Vector3 b = body.footPosition - body.transform.position; TeleportHelper.TeleportGameObject(body.gameObject, targetFootPosition - b); }
// Token: 0x0600155A RID: 5466 RVA: 0x0005B03C File Offset: 0x0005923C private void OnPassengerExit(GameObject passenger) { if (VehicleSeat.shouldLog) { Debug.Log("Releasing passenger."); } if (this.hidePassenger && this.passengerInfo.characterModel) { this.passengerInfo.characterModel.invisibilityCount--; } if (this.passengerInfo.body) { this.passengerInfo.body.currentVehicle = null; } if (this.passengerInfo.characterMotor) { if (this.disablePassengerMotor) { this.passengerInfo.characterMotor.enabled = true; } else { this.passengerInfo.characterMotor.onMovementHit -= this.OnPassengerMovementHit; } this.passengerInfo.characterMotor.velocity = Vector3.zero; this.passengerInfo.characterMotor.rootMotion = Vector3.zero; this.passengerInfo.characterMotor.Motor.BaseVelocity = Vector3.zero; } if (this.passengerInfo.collider && this.collider) { Physics.IgnoreCollision(this.collider, this.passengerInfo.collider, false); } if (this.passengerInfo.hasEffectiveAuthority) { if (this.passengerInfo.bodyStateMachine && this.passengerInfo.bodyStateMachine.CanInterruptState(InterruptPriority.Vehicle)) { this.passengerInfo.bodyStateMachine.SetNextStateToMain(); } Vector3 newPosition = this.exitPosition ? this.exitPosition.position : this.seatPosition.position; TeleportHelper.TeleportGameObject(this.passengerInfo.transform.gameObject, newPosition); } if (this.passengerInfo.interactionDriver && this.passengerInfo.interactionDriver.interactableOverride == base.gameObject) { this.passengerInfo.interactionDriver.interactableOverride = null; } if (this.rigidbody && this.passengerInfo.characterMotor) { this.passengerInfo.characterMotor.velocity = this.rigidbody.velocity * this.exitVelocityFraction; } Action <GameObject> action = this.onPassengerExit; if (action != null) { action(this.passengerBodyObject); } UnityEvent unityEvent = this.onPassengerExitUnityEvent; if (unityEvent != null) { unityEvent.Invoke(); } Action <VehicleSeat, GameObject> action2 = VehicleSeat.onPassengerExitGlobal; if (action2 == null) { return; } action2(this, this.passengerBodyObject); }