public void CmdTeleport(Vector3 position, Vector3 rotation, float tempOwnerTime) { RpcTeleport(position, rotation, tempOwnerTime); VehicleState teleportState = new VehicleState(); teleportState.CopyFromVehicleSync(this); teleportState.position = position; teleportState.rotation = Quaternion.Euler(rotation); teleportState.ownerTimestamp = tempOwnerTime; teleportState.teleport = true; TeleportStateAdd(teleportState); }
public void RpcTeleport(Vector3 position, Vector3 rotation, float tempOwnerTime) { if (hasAuthorityOrUnownedOnServer || NetworkServer.active) { return; } VehicleState teleportState = new VehicleState(); teleportState.CopyFromVehicleSync(this); teleportState.position = position; teleportState.rotation = Quaternion.Euler(rotation); teleportState.ownerTimestamp = tempOwnerTime; teleportState.teleport = true; TeleportStateAdd(teleportState); }
public void CopyFromVehicleSync(VehicleSync VehicleSyncScript) { this.VehicleSync = VehicleSyncScript; vehicleState.CopyFromVehicleSync(VehicleSyncScript); }