This commit is contained in:
vis2k 2021-03-13 13:52:14 +08:00
parent b2892e7e1a
commit 89df32563b

View File

@ -898,10 +898,10 @@ internal static void ApplySpawnPayload(NetworkIdentity identity, SpawnMessage me
} }
// Finds Existing Object with NetId or spawns a new one using AssetId or sceneId // Finds Existing Object with NetId or spawns a new one using AssetId or sceneId
internal static bool FindOrSpawnObject(SpawnMessage msg, out NetworkIdentity identity) internal static bool FindOrSpawnObject(SpawnMessage message, out NetworkIdentity identity)
{ {
// was the object already spawned? // was the object already spawned?
identity = GetExistingObject(msg.netId); identity = GetExistingObject(message.netId);
// if found, return early // if found, return early
if (identity != null) if (identity != null)
@ -909,17 +909,17 @@ internal static bool FindOrSpawnObject(SpawnMessage msg, out NetworkIdentity ide
return true; return true;
} }
if (msg.assetId == Guid.Empty && msg.sceneId == 0) if (message.assetId == Guid.Empty && message.sceneId == 0)
{ {
Debug.LogError($"OnSpawn message with netId '{msg.netId}' has no AssetId or sceneId"); Debug.LogError($"OnSpawn message with netId '{message.netId}' has no AssetId or sceneId");
return false; return false;
} }
identity = msg.sceneId == 0 ? SpawnPrefab(msg) : SpawnSceneObject(msg); identity = message.sceneId == 0 ? SpawnPrefab(message) : SpawnSceneObject(message);
if (identity == null) if (identity == null)
{ {
Debug.LogError($"Could not spawn assetId={msg.assetId} scene={msg.sceneId:X} netId={msg.netId}"); Debug.LogError($"Could not spawn assetId={message.assetId} scene={message.sceneId:X} netId={message.netId}");
return false; return false;
} }