Skip to content

Commit 76d3eea

Browse files
committed
Added automatically generated PrefabHashGenerators
1 parent f5cdaed commit 76d3eea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

MLAPI/MonoBehaviours/Core/NetworkedObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ private void OnValidate()
2222
if (string.IsNullOrEmpty(PrefabHashGenerator))
2323
{
2424
PrefabHash = 0;
25+
if (LogHelper.CurrentLogLevel <= LogLevel.Normal) LogHelper.LogWarning("The NetworkedObject " + gameObject.name + " does not have a PrefabHashGenerator. It has been set to the gameObject name");
26+
PrefabHashGenerator = gameObject.name;
2527
}
26-
else
27-
{
28-
PrefabHash = PrefabHashGenerator.GetStableHash64();
29-
}
28+
29+
PrefabHash = PrefabHashGenerator.GetStableHash64();
3030
}
3131

3232
/// <summary>

0 commit comments

Comments
 (0)