mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServer.SpawnObject shows a warning when called with a server-only NetworkIdentity
This commit is contained in:
parent
f6dbf8c19e
commit
ede2c6c2c2
@ -1060,6 +1060,14 @@ internal static void SpawnObject(GameObject obj, NetworkConnection ownerConnecti
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// spawning a server-only NetworkIdentity won't do anything, but
|
||||||
|
// might confuse someone. let's show a warning.
|
||||||
|
if (identity.serverOnly)
|
||||||
|
{
|
||||||
|
logger.LogWarning("SpawnObject for " + obj + " is server-only. Calling NetworkServer.Spawn wouldn't do anything.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (identity.SpawnedFromInstantiate)
|
if (identity.SpawnedFromInstantiate)
|
||||||
{
|
{
|
||||||
// Using Instantiate on SceneObject is not allowed, so stop spawning here
|
// Using Instantiate on SceneObject is not allowed, so stop spawning here
|
||||||
|
Loading…
Reference in New Issue
Block a user