Skip to content

Commit 209e64c

Browse files
committed
fix: Fixes player prefab hash serialization on IL2CPP
1 parent fc399a5 commit 209e64c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

MLAPI/Configuration/NetworkConfig.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212
namespace MLAPI.Configuration
1313
{
14+
[Serializable]
15+
internal class NullableBoolSerializable
16+
{
17+
[SerializeField]
18+
public ulong Value;
19+
}
20+
1421
/// <summary>
1522
/// The configuration object used to start server, client and hosts
1623
/// </summary>
@@ -48,7 +55,7 @@ public class NetworkConfig
4855
/// The default player prefab
4956
/// </summary>
5057
[SerializeField]
51-
internal ulong? PlayerPrefabHash;
58+
internal NullableBoolSerializable PlayerPrefabHash;
5259
/// <summary>
5360
/// Whether or not a player object should be created by default. This value can be overriden on a case by case basis with ConnectionApproval.
5461
/// </summary>

MLAPI/Core/NetworkingManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ private void OnValidate()
303303
}
304304
else
305305
{
306-
NetworkConfig.PlayerPrefabHash = prefab.Hash;
306+
NetworkConfig.PlayerPrefabHash.Value = prefab.Hash;
307307
}
308308
}
309309

0 commit comments

Comments
 (0)