more sorting

This commit is contained in:
vis2k 2021-03-07 15:37:32 +08:00
parent 632a4a8cc2
commit 0fe5d30c00

View File

@ -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;
}
/// <summary>Spawn the given game object on all clients which are ready.</summary>
// 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 ||