UndoPropertyModification[] PostprocessModifications(UndoPropertyModification[] modifications) { foreach (var mod in modifications) { var target = GetGameObjectFromAny(mod.currentValue.target); if (target) { var liveLink = GetLiveLink(target.scene); if (liveLink != null) { liveLink.AddChanged(target); EditorUpdateUtility.EditModeQueuePlayerLoopUpdate(); } } } if (m_AssetDependencies.Count() > 0) { foreach (var mod in modifications) { AssetDatabase.TryGetGUIDAndLocalFileIdentifier(mod.currentValue.target, out var guid, out long _); if (m_AssetDependencies.ContainsKey(new GUID(guid))) { GlobalDirtyLiveLink(); break; } } } return(modifications); }
internal void MarkAssetChanged(GUID asset) { if (!_RequestCleanConversion && m_AssetDependencies.ContainsKey(asset)) { RequestCleanConversion(); } }
public void DeallocateSystemData(uint systemId) { if (!UnsafeHashMap.ContainsKey(SystemData, systemId)) { throw new InvalidOperationException(); } UnsafeUtility.Free((void *)UnsafeHashMap.Get <uint, IntPtr>(SystemData, systemId), Allocator.Persistent); UnsafeHashMap.Remove(SystemData, systemId); }
public ref SystemGhostData GetGhostData(uint systemId) { if (!UnsafeHashMap.ContainsKey(SystemToGhostIds, systemId)) { var data = new SystemGhostData { GhostIds = new UnsafeList <uint>(64, Allocator.Persistent) }; UnsafeHashMap.Set(SystemToGhostIds, systemId, UnsafeUtility.AddressOf(ref data), UnsafeUtility.SizeOf <SystemGhostData>()); return(ref UnsafeUtility.AsRef <SystemGhostData>(UnsafeHashMap.GetPtr(SystemToGhostIds, systemId))); } return(ref UnsafeUtility.AsRef <SystemGhostData>(UnsafeHashMap.GetPtr(SystemToGhostIds, systemId))); }
public ref SystemChunkData GetChunkData(uint systemId) { if (!UnsafeHashMap.ContainsKey(SystemToChunks, systemId)) { var data = new SystemChunkData { Chunks = new UnsafeList <ArchetypeChunk>(64, Allocator.Persistent) }; UnsafeHashMap.Set(SystemToChunks, systemId, UnsafeUtility.AddressOf(ref data), UnsafeUtility.SizeOf <SystemChunkData>()); return(ref UnsafeUtility.AsRef <SystemChunkData>(UnsafeHashMap.GetPtr(SystemToChunks, systemId))); } return(ref UnsafeUtility.AsRef <SystemChunkData>(UnsafeHashMap.GetPtr(SystemToChunks, systemId))); }
public void UnsafeHashMap_AddJob() { var container = new UnsafeHashMap <int, int>(32, Allocator.TempJob); var job = new UnsafeHashMapAddJob() { Writer = container.AsParallelWriter(), }; job.Schedule().Complete(); Assert.True(container.ContainsKey(123)); container.Dispose(); }
internal void AddOrUpdateInt(FixedString128 key, TinyJsonObject value) { JsonKeyHandle jsonRefHandle; if (m_RootObjMap.ContainsKey(key)) { jsonRefHandle = m_RootObjMap[key]; if (JsonKeyType(jsonRefHandle) == JsonValueType.Int) { // simple value swap if its the same type m_IntBuffer[LocationInValueBuffer(jsonRefHandle)] = value.AsInt(); return; } // remove the old type completely and add a new one as normal RemoveValueFromBuffer(jsonRefHandle); } jsonRefHandle = new JsonKeyHandle(ref this, JsonValueType.Int, m_IntBuffer.Length); m_IntBuffer.Add(value.AsInt()); m_RootObjMap[key] = jsonRefHandle; }
/// <summary> /// Determines whether an key is in the container. /// </summary> /// <param name="key">The key to locate in the container.</param> /// <returns>Returns true if the container contains the key.</returns> public bool ContainsKey(TKey key) { CheckRead(); return(m_HashMapData.ContainsKey(key)); }