示例#1
0
        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);
        }
示例#2
0
        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);
 }