refactor: NetworkTransform.SetState shouldGhostsInterpolate parameter [MTT-4462] (#2228)

* refactor
MTT-4462
Renaming shouldGhostsInterpolate to teleportDisabled for better clarity of what that parameter does.  While renaming it to isTeleporting would make more sense, that could potentially become a breaking change, and so the next best parameter name would be "teleportDisabled" which would not break users that use this parameter currently.
This commit is contained in:
Noel Stephens 2022-12-02 13:44:57 -06:00 коммит произвёл GitHub
Родитель 101bf34cae
Коммит ade8ce53c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -13,6 +13,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Changed
- The default listen address of `UnityTransport` is now 0.0.0.0. (#2307)
- Renamed the NetworkTransform.SetState parameter `shouldGhostsInterpolate` to `teleportDisabled` for better clarity of what that parameter does. (#2228)
### Fixed
- Fixed server side issue where, depending upon component ordering, some NetworkBehaviour components might not have their OnNetworkDespawn method invoked if the client side disconnected. (#2323)

Просмотреть файл

@ -1092,10 +1092,9 @@ namespace Unity.Netcode.Components
/// <param name="posIn"></param> new position to move to. Can be null
/// <param name="rotIn"></param> new rotation to rotate to. Can be null
/// <param name="scaleIn">new scale to scale to. Can be null</param>
/// <param name="shouldGhostsInterpolate">Should other clients interpolate this change or not. True by default</param>
/// new scale to scale to. Can be null
/// <param name="teleportDisabled">When true (the default) the <see cref="NetworkObject"/> will not be teleported and, if enabled, will interpolate. When false the <see cref="NetworkObject"/> will teleport/apply the parameters provided immediately.</param>
/// <exception cref="Exception"></exception>
public void SetState(Vector3? posIn = null, Quaternion? rotIn = null, Vector3? scaleIn = null, bool shouldGhostsInterpolate = true)
public void SetState(Vector3? posIn = null, Quaternion? rotIn = null, Vector3? scaleIn = null, bool teleportDisabled = true)
{
if (!IsSpawned)
{
@ -1119,16 +1118,16 @@ namespace Unity.Netcode.Components
{
m_ClientIds[0] = OwnerClientId;
m_ClientRpcParams.Send.TargetClientIds = m_ClientIds;
SetStateClientRpc(pos, rot, scale, !shouldGhostsInterpolate, m_ClientRpcParams);
SetStateClientRpc(pos, rot, scale, !teleportDisabled, m_ClientRpcParams);
}
else // Preserving the ability for server authoritative mode to accept state changes from owner
{
SetStateServerRpc(pos, rot, scale, !shouldGhostsInterpolate);
SetStateServerRpc(pos, rot, scale, !teleportDisabled);
}
return;
}
SetStateInternal(pos, rot, scale, !shouldGhostsInterpolate);
SetStateInternal(pos, rot, scale, !teleportDisabled);
}
/// <summary>