public void OnPipelineInitialized() { m_ObjectHandle = m_MemTracker.CreateCache <StreamKey, TObject>(GetDestructor()); m_Hub.Broadcast(new MemoryTrackerCacheCreatedEvent <TObject>(m_ObjectHandle)); }
public MemoryTrackerCacheCreatedEvent(MemoryTracker.Handle <StreamKey, TObject> handle) { this.handle = handle; }
public InstanceConverter(EventHub hub, MemoryTracker memTracker, Transform root, bool generateSourceRoots, IMaterialCache materialCache, IMeshCache meshCache, ISyncLightImporter lightImporter, DataOutput <GameObject> output) { m_Hub = hub; m_MemTracker = memTracker; m_MaterialCache = materialCache; m_MeshCache = meshCache; m_Output = output; m_SyncLightImporter = lightImporter; m_Originals = new Dictionary <StreamKey, OriginalInstance>(); m_Root = root; m_SourceRoots = generateSourceRoots ? new Dictionary <string, Transform>() : null; m_SyncObjects = new Dictionary <StreamKey, SyncObject>(); m_Instances = new Dictionary <StreamKey, SyncObjectBinding>(); m_HubGroup = m_Hub.CreateGroup(); m_Hub.Subscribe <PeriodicMemoryEvent>(m_HubGroup, OnPeriodicMemoryEvent); m_Hub.Subscribe <MemoryTrackerCacheCreatedEvent <Mesh> >(m_HubGroup, e => m_MeshesHandle = e.handle); }
public DataProvider(EventHub hub, MemoryTracker memTracker, ISyncModelProvider client, IHashProvider hashProvider, DataOutput <SyncMesh> syncMeshOutput, DataOutput <SyncMaterial> syncMaterialOutput, DataOutput <SyncTexture> syncTextureOutput, DataOutput <StreamInstanceData> instanceDataOutput) { m_Hub = hub; m_MemTracker = memTracker; m_Client = client; m_HashProvider = hashProvider; m_SyncMaterialOutput = syncMaterialOutput; m_SyncMeshOutput = syncMeshOutput; m_SyncTextureOutput = syncTextureOutput; m_InstanceDataOutput = instanceDataOutput; m_DownloadRequests = new ConcurrentQueue <IStream>(); m_DownloadedInstances = new ConcurrentQueue <DownloadResult>(); m_DownloadedModels = new ConcurrentQueue <ObjectDownloadResult>(); m_StreamCaches = new Dictionary <StreamKey, StreamCache>(); m_InstanceCache = new Dictionary <StreamKey, StreamInstanceData>(); m_AddedModels = new HashSet <StreamKey>(); m_HubHandle = m_Hub.Subscribe <MemoryTrackerCacheCreatedEvent <Mesh> >(e => m_MeshesHandle = e.handle); }