protected virtual void CaptureObjects(NetworkObject pObj) { if (pObj.CreateCode < 0) { return; } MainThreadManager.Run(() => { NetworkBehavior newObj = null; if (!NetworkBehavior.skipAttachIds.TryGetValue(pObj.NetworkId, out newObj)) { GameObject templateObj = _networkBehaviorListSO.behaviorList.GetByCreateCode(pObj.CreateCode); if (templateObj != null) { var go = Instantiate(templateObj); newObj = go.GetComponent <NetworkBehavior>(); } } if (newObj == null) { return; } SetINetworkSceneObject(newObj, pObj); newObj.Initialize(pObj); if (OnObjectInitialized != null) { OnObjectInitialized(newObj, pObj); } }); }