Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor fixes for 2.1.0 #3097

Merged
merged 8 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Additional documentation and release notes are available at [Multiplayer Documen
[Unreleased]

### Added


- Added ability to edit the `NetworkConfig.AutoSpawnPlayerPrefabClientSide` within the inspector view. (#3097)
- Added `IContactEventHandlerWithInfo` that derives from `IContactEventHandler` that can be updated per frame to provide `ContactEventHandlerInfo` information to the `RigidbodyContactEventManager` when processing collisions. (#3094)
- `ContactEventHandlerInfo.ProvideNonRigidBodyContactEvents`: When set to true, non-`Rigidbody` collisions with the registered `Rigidbody` will generate contact event notifications. (#3094)
- `ContactEventHandlerInfo.HasContactEventPriority`: When set to true, the `Rigidbody` will be prioritized as the instance that generates the event if the `Rigidbody` colliding does not have priority. (#3094)
Expand All @@ -27,6 +28,8 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Changed

- Changed `NetworkConfig.AutoSpawnPlayerPrefabClientSide` is no longer automatically set when starting `NetworkManager`. (#3097)

## [2.0.0] - 2024-09-12

### Added
Expand Down
20 changes: 20 additions & 0 deletions com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class NetworkManagerEditor : NetcodeEditorBase<NetworkManager>
private SerializedProperty m_NetworkTransportProperty;
private SerializedProperty m_TickRateProperty;
#if MULTIPLAYER_SERVICES_SDK_INSTALLED
private SerializedProperty m_AutoSpawnPlayerPrefabClientSide;
private SerializedProperty m_NetworkTopologyProperty;
#endif
private SerializedProperty m_ClientConnectionBufferTimeoutProperty;
Expand Down Expand Up @@ -104,6 +105,11 @@ private void Initialize()
m_TickRateProperty = m_NetworkConfigProperty.FindPropertyRelative("TickRate");
#if MULTIPLAYER_SERVICES_SDK_INSTALLED
m_NetworkTopologyProperty = m_NetworkConfigProperty.FindPropertyRelative("NetworkTopology");
// Only display the auto spawn property when the distributed authority network topology is selected
if (m_NetworkManager.NetworkConfig.NetworkTopology == NetworkTopologyTypes.DistributedAuthority)
{
m_AutoSpawnPlayerPrefabClientSide = m_NetworkConfigProperty.FindPropertyRelative("AutoSpawnPlayerPrefabClientSide");
}
#endif
m_ClientConnectionBufferTimeoutProperty = m_NetworkConfigProperty.FindPropertyRelative("ClientConnectionBufferTimeout");
m_ConnectionApprovalProperty = m_NetworkConfigProperty.FindPropertyRelative("ConnectionApproval");
Expand Down Expand Up @@ -142,6 +148,11 @@ private void CheckNullProperties()
m_TickRateProperty = m_NetworkConfigProperty.FindPropertyRelative("TickRate");
#if MULTIPLAYER_SERVICES_SDK_INSTALLED
m_NetworkTopologyProperty = m_NetworkConfigProperty.FindPropertyRelative("NetworkTopology");
// Only display the auto spawn property when the distributed authority network topology is selected
if (m_NetworkManager.NetworkConfig.NetworkTopology == NetworkTopologyTypes.DistributedAuthority)
{
m_AutoSpawnPlayerPrefabClientSide = m_NetworkConfigProperty.FindPropertyRelative("AutoSpawnPlayerPrefabClientSide");
}
#endif
m_ClientConnectionBufferTimeoutProperty = m_NetworkConfigProperty.FindPropertyRelative("ClientConnectionBufferTimeout");
m_ConnectionApprovalProperty = m_NetworkConfigProperty.FindPropertyRelative("ConnectionApproval");
Expand Down Expand Up @@ -221,8 +232,17 @@ private void DisplayNetworkManagerProperties()
EditorGUILayout.Space();
EditorGUILayout.LabelField("Prefab Settings", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_ForceSamePrefabsProperty);
#if MULTIPLAYER_SERVICES_SDK_INSTALLED
// Only display the auto spawn property when the distributed authority network topology is selected
if (m_NetworkManager.NetworkConfig.NetworkTopology == NetworkTopologyTypes.DistributedAuthority)
{
EditorGUILayout.PropertyField(m_AutoSpawnPlayerPrefabClientSide, new GUIContent("Auto Spawn Player Prefab"));
}
#endif
EditorGUILayout.PropertyField(m_PlayerPrefabProperty, new GUIContent("Default Player Prefab"));



if (m_NetworkManager.NetworkConfig.HasOldPrefabList())
{
EditorGUILayout.HelpBox("Network Prefabs serialized in old format. Migrate to new format to edit the list.", MessageType.Info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,9 +1161,6 @@ internal void Initialize(bool server)

UpdateTopology();

//DANGOEXP TODO: Remove this before finalizing the experimental release
NetworkConfig.AutoSpawnPlayerPrefabClientSide = DistributedAuthorityMode;

// Make sure the ServerShutdownState is reset when initializing
if (server)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public void DeferDespawn(int tickOffset, bool destroy = true)

if (!HasAuthority)
{
NetworkLog.LogError($"Only the authoirty can invoke {nameof(DeferDespawn)} and local Client-{NetworkManager.LocalClientId} is not the authority of {name}!");
NetworkLog.LogError($"Only the authority can invoke {nameof(DeferDespawn)} and local Client-{NetworkManager.LocalClientId} is not the authority of {name}!");
return;
}

Expand Down
Loading