diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 38eb2c303..07b5bd64d 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -868,6 +868,16 @@ static void SpawnObject(GameObject obj, NetworkConnection ownerConnection) RebuildObservers(identity, true); } + static bool VerifyCanSpawn(GameObject obj) + { + if (Utils.IsPrefab(obj)) + { + Debug.LogError($"GameObject {obj.name} is a prefab, it can't be spawned. This will cause errors in builds."); + return false; + } + return true; + } + /// Spawn the given game object on all clients which are ready. // This will cause a new object to be instantiated from the registered // prefab, or from a custom spawn function. @@ -913,16 +923,6 @@ public static void Spawn(GameObject obj, Guid assetId, NetworkConnection ownerCo } } - static bool VerifyCanSpawn(GameObject obj) - { - if (Utils.IsPrefab(obj)) - { - Debug.LogError($"GameObject {obj.name} is a prefab, it can't be spawned. This will cause errors in builds."); - return false; - } - return true; - } - internal static bool ValidateSceneObject(NetworkIdentity identity) { if (identity.gameObject.hideFlags == HideFlags.NotEditable ||