Skip to content

Commit 31e5e1d

Browse files
fix: Generate Default Network Prefabs List setting not loading correctly (#2545)
* fix: Generate Default Network Prefabs List setting not loading correctly * Changelog --------- Co-authored-by: Noel Stephens <[email protected]>
1 parent b985087 commit 31e5e1d

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ Additional documentation and release notes are available at [Multiplayer Documen
1212

1313
### Fixed
1414

15+
- Fixed the "Generate Default Network Prefabs List" setting not loading correctly and always reverting to being checked. (#2545)
16+
- Fixed the inspector throwing exceptions when attempting to render `NetworkVariable`s of enum types. (#2529)
17+
- Making a `NetworkVariable` with an `INetworkSerializable` type that doesn't meet the `new()` constraint will now create a compile-time error instead of an editor crash (#2528)
1518
- Fixed Multiplayer Tools package installation docs page link on the NetworkManager popup. (#2526)
19+
- Fixed an exception and error logging when two different objects are shown and hidden on the same frame (#2524)
1620
- Fixed a memory leak in `UnityTransport` that occurred if `StartClient` failed. (#2518)
1721
- Fixed issue where a client could throw an exception if abruptly disconnected from a network session with one or more spawned `NetworkObject`(s). (#2510)
1822
- Fixed issue where invalid endpoint addresses were not being detected and returning false from NGO UnityTransport. (#2496)
1923
- Fixed some errors that could occur if a connection is lost and the loss is detected when attempting to write to the socket. (#2495)
20-
- Making a `NetworkVariable` with an `INetworkSerializable` type that doesn't meet the `new()` constraint will now create a compile-time error instead of an editor crash (#2528)
21-
- Fixed the inspector throwing exceptions when attempting to render `NetworkVariable`s of enum types. (#2529)
22-
- Fixed an exception and error logging when two different objects are shown and hidden on the same frame (#2524)
2324

2425
## Changed
2526

com.unity.netcode.gameobjects/Editor/Configuration/NetcodeForGameObjectsSettings.cs

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using UnityEditor;
22
using UnityEngine;
3+
using UnityEngine.Serialization;
34

45

56
namespace Unity.Netcode.Editor.Configuration
@@ -43,7 +44,21 @@ internal static void SetAutoAddNetworkObjectSetting(bool autoAddSetting)
4344
[FilePath("ProjectSettings/NetcodeForGameObjects.settings", FilePathAttribute.Location.ProjectFolder)]
4445
internal class NetcodeForGameObjectsProjectSettings : ScriptableSingleton<NetcodeForGameObjectsProjectSettings>
4546
{
46-
[SerializeField] public bool GenerateDefaultNetworkPrefabs = true;
47+
[SerializeField]
48+
[FormerlySerializedAs("GenerateDefaultNetworkPrefabs")]
49+
private byte m_GenerateDefaultNetworkPrefabs;
50+
51+
public bool GenerateDefaultNetworkPrefabs
52+
{
53+
get
54+
{
55+
return m_GenerateDefaultNetworkPrefabs != 0;
56+
}
57+
set
58+
{
59+
m_GenerateDefaultNetworkPrefabs = (byte)(value ? 1 : 0);
60+
}
61+
}
4762

4863
internal void SaveSettings()
4964
{

0 commit comments

Comments
 (0)