diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 489af4f446..db93801f9a 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -10,6 +10,19 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Added + +### Fixed + +- Fixed issue where viewing a `NetworkBehaviour` with one or more `NetworkVariable` fields could throw an exception if running a distributed authority network topology with a local (DAHost) host and viewed on the host when the host is not the authority of the associated `NetworkObject`. (#3578) +- Fixed issue when using a distributed authority network topology and viewing a `NetworkBehaviour` with one or more `NetworkVariable` fields in the inspector view would not show editable fields. (#3578) + +### Changed + + +## [2.5.0] - 2025-08-01 + +### Added + - Added serializer for `Pose` (#3546) - Added methods `GetDefaultNetworkSettings` and `GetDefaultPipelineConfigurations` to `UnityTransport`. These can be used to retrieve the default settings and pipeline stages that are used by `UnityTransport`. This is useful when providing a custom driver constructor through `UnityTransport.s_DriverConstructor`, since it allows reusing or tuning the existing configuration instead of trying to recreate it. This means a transport with a custom driver can now easily benefit from most of the features of `UnityTransport`, like integration with the Network Simulator and Network Profiler from the multiplayer tools package. (#3501) - Added mappings between `ClientId` and `TransportId`. (#3516) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index 62e60fb436..f871b79331 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -529,11 +529,21 @@ public bool IsSessionOwner internal bool IsBehaviourEditable() { - // Only server can MODIFY. So allow modification if network is either not running or we are server - return !m_NetworkObject || - m_NetworkObject.NetworkManager == null || - m_NetworkObject.NetworkManager.IsListening == false || - m_NetworkObject.NetworkManager.IsServer; + if (!m_NetworkObject) + { + return true; + } + + if (!m_NetworkObject.NetworkManager) + { + return true; + } + + var networkManager = m_NetworkObject.NetworkManager; + + // Only the authority can MODIFY. So allow modification if network is either not running or we are the authority. + return !networkManager.IsListening || + ((networkManager.DistributedAuthorityMode && m_NetworkObject.IsOwner) || (!networkManager.DistributedAuthorityMode && networkManager.IsServer)); } // TODO: this needs an overhaul. It's expensive, it's ja little naive in how it looks for networkObject in