Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.3.2] - 2024-09-06

### Added

* Overloads for `ComponentLookup.HasComponent`, `ComponentLookup.TryGetComponent`, `BufferLookup.HasBuffer`, and `BufferLookup.TryGetBuffer` adding parameter `out bool entityExists`, as well as dedicated `ComponentLookup.EntityExists` and `BufferLookup.EntityExists` APIs, to allow user-code to distinguish entity non-existence from component non-existence without additional boilerplate, inside jobs.
* adding missing dependencies `com.unity.modules.physics`, `com.unity.modules.uielements`.

### Changed

* Updated Burst dependency to version 1.8.17
* Add API docs discouraging the use of the `ExclusiveEntityTransaction.EntityManager` property. Many EntityManager operations are not safe to use within the context of an ExclusiveEntityTransaction; only the methods directly exposed by `ExclusiveEntityTransaction` are guaranteed to work correctly.
* Add API docs discouraging the creation of `EntityQuery` objects with multiple query descriptions. This feature works in narrow contexts, but is known to cause errors and incompatibilities with other DOTS features.
* Add API docs to note that enabling and disabling components inside `IJobEntityChunkBeginEnd.OnChunkBegin()` does not affect the entities iterated in the current chunk, as its `chunkEnabledMask` has already been computed.
* Zero-size `IBufferElementData` and `ISharedComponentData` structs no longer cause the TypeManager to throw during initialization. Zero-size buffer and shared components are usually a sign of pointless waste (especially buffer components, which have a significant chunk-memory cost even if the actual elements are empty), but they shouldn't cause a fatal error.

### Fixed

* Various SGICE002 errors that happen if you type invalid C# code
* Various SGICE003 errors that happen if you type invalid C# code
* NullReferenceException on UnityObjectRef<T> after Asset Garbage Collection (This fix requires editor versions 2022.3.43f1 and 6000.0.16f1 and beyond)
  • Loading branch information
Unity Technologies committed Sep 6, 2024
1 parent 69124c8 commit 55ca11e
Show file tree
Hide file tree
Showing 66 changed files with 1,311 additions and 391 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ uid: changelog

# Changelog

## [1.3.2] - 2024-09-06

### Added

* Overloads for `ComponentLookup.HasComponent`, `ComponentLookup.TryGetComponent`, `BufferLookup.HasBuffer`, and `BufferLookup.TryGetBuffer` adding parameter `out bool entityExists`, as well as dedicated `ComponentLookup.EntityExists` and `BufferLookup.EntityExists` APIs, to allow user-code to distinguish entity non-existence from component non-existence without additional boilerplate, inside jobs.
* adding missing dependencies `com.unity.modules.physics`, `com.unity.modules.uielements`.

### Changed

* Updated Burst dependency to version 1.8.17
* Add API docs discouraging the use of the `ExclusiveEntityTransaction.EntityManager` property. Many EntityManager operations are not safe to use within the context of an ExclusiveEntityTransaction; only the methods directly exposed by `ExclusiveEntityTransaction` are guaranteed to work correctly.
* Add API docs discouraging the creation of `EntityQuery` objects with multiple query descriptions. This feature works in narrow contexts, but is known to cause errors and incompatibilities with other DOTS features.
* Add API docs to note that enabling and disabling components inside `IJobEntityChunkBeginEnd.OnChunkBegin()` does not affect the entities iterated in the current chunk, as its `chunkEnabledMask` has already been computed.
* Zero-size `IBufferElementData` and `ISharedComponentData` structs no longer cause the TypeManager to throw during initialization. Zero-size buffer and shared components are usually a sign of pointless waste (especially buffer components, which have a significant chunk-memory cost even if the actual elements are empty), but they shouldn't cause a fatal error.

### Fixed

* Various SGICE002 errors that happen if you type invalid C# code
* Various SGICE003 errors that happen if you type invalid C# code
* NullReferenceException on UnityObjectRef<T> after Asset Garbage Collection (This fix requires editor versions 2022.3.43f1 and 6000.0.16f1 and beyond)


## [1.3.0-pre.4] - 2024-07-17

### Changed
Expand All @@ -22,6 +44,7 @@ uid: changelog
* EntityComponentStore leaked memory during domain reload.



## [1.3.0-exp.1] - 2024-06-11

### Added
Expand Down Expand Up @@ -68,6 +91,18 @@ uid: changelog
### Known Issues


## [1.2.4] - 2024-08-14

### Fixed

* Debug proxies (used by external debuggers) were sometimes using invalid field offsets when inspecting structs in blob assets. This led to incorrect values being reported in debugger watch windows. In particular, this would be triggered by the use of bool fields in blob asset structs.
* Entity version numbers could go back to 1 after reallocation in some edge cases.
* When building a content update, a temporary path was getting created in the drive root instead of the Library folder. This would also cause content update builds to grow in size every time they were built. The folder is now created in the Library correctly.
* Error in build when sprites are contained in subscenes has been removed.
* Regression in compilation time with assemblies with lots of system methods.
* EntityComponentStore leaked memory during domain reload.


## [1.2.3] - 2024-05-30

### Fixed
Expand Down
8 changes: 7 additions & 1 deletion Documentation~/concepts-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ One of the most common issues with safety in Entities is when [structural change
The Entities API stores data in chunks that are typically accessed through the [job system](xref:JobSystem) or the main thread. The job system typically handles all safety of data that's passed in with NativeContainers, and uses notations to mark if the data is read from, written to, or both. However, any API that causes a structural change might make this data move in memory and invalidate any reference held to that data.

#### ExclusiveEntityTransaction

In general, all structural changes must be made on the main thread using the world's `EntityManager`. The `ExclusiveEntityTransaction` feature allows you to temporarily place an `EntityManager` into a mode where a single worker thread (running an `IJob`) can safely perform structural-change operations on that World's entities, leaving the main thread free to perform other work.

The main motivation for this feature is to allow a secondary / streaming World to safely modify its entities and perform structural changes, without blocking the main thread from processing entities in the default World. It is not intended as a fully general-purpose interface to `EntityManager` functionality from worker threads. Certain `EntityManager` operations rely on main-thread-only features in their implementation, and will therefore not function correctly if called from job code. Only the subset of operations directly exposed by `ExclusiveEntityTransaction` are officially supported.

### RefRW/RefRO

The Entities package contains explicit reference types that you can use to mark the contained type to be accessed as ReadWrite (`RefRW`) or ReadOnly (`RefRO`). These reference types have checks to ensure that the contained type is still valid when running with safety checks enabled. [Structural changes](concepts-structural-changes.md) might cause the contained type to no longer be valid.
Expand All @@ -34,4 +40,4 @@ There are a few cases that aren't guarded against. This section outlines any cas
The `InternalCompilerInterface` static class includes a number of methods that expose some of the DOTS internals to source-generated code. This is necessary because generated code can only typically call public APIs.

>[!WARNING]
>Do not use the APIs contained in InternalCompilerInterface. They are only in the context of being called from generated code and are likely to change in the future.
>Do not use the APIs contained in InternalCompilerInterface. They are only in the context of being called from generated code and are likely to change in the future.
1 change: 0 additions & 1 deletion Documentation~/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ See the [DOTS Guide and Samples](https://github.com/Unity-Technologies/EntityCom

* 2022.3 (LTS)
* 2023.3 (Latest Beta and beyond)
* Unity 6

## Package installation

Expand Down
14 changes: 8 additions & 6 deletions Documentation~/systems-entityquery-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ The query uses [`EntityQueryBuilder.WithAllRW<T>`](xref:Unity.Entities.EntityQue

## Specify which archetypes the system selects

Queries only match archetypes that contain the components you specify. You can specify components with three different [`EntityQueryBuilder`](xref:Unity.Entities.EntityQueryBuilder) methods:

* `WithAll<T>()`: To match the query, an archetype must contain all the query's required components.
* `WithAny<T>()`: To match the query, an archetype must contain at least one of the query's optional components.
* `WithNone<T>()`: To match the query, an archetype must not contain any of the query's excluded components.
* `WithAspect<T>()`: To match the query, an archetype must meet the [aspect’s](aspects-intro.md) component requirements. Use last when building a query to avoid component aliasing.
Queries only match archetypes that contain the components you specify. You can specify components with the following [`EntityQueryBuilder`](xref:Unity.Entities.EntityQueryBuilder) methods:

* `WithAll<T>()`: To match the query, an entity's archetype must contain all the query's required components, and these components must be enabled on that entity.
* `WithAny<T>()`: To match the query, an entity's archetype must contain at least one of the query's optional components, and these components must be enabled on that entity.
* `WithNone<T>()`: To match the query, either an entity's archetype must not contain any of the query's excluded components, or the components must be present but disabled on that entity.
* `WithDisabled<T>()`: To match the query, an entity's archetype must contain this component, and the component must be disabled on that entity.
* `WithAbsent<T>()`: To match the query, an entity's archetype must not contain the specified components.
* `WithPresent<T>()`: To match the query, an entity's archetype must contain the specified components (whether or not they are enabled).

For example, the following query includes archetypes that contain the `ObjectRotation` and `ObjectRotationSpeed`components, but excludes any archetypes that contain the `Static` component:

Expand Down
2 changes: 1 addition & 1 deletion Unity.Deformations/DeformationComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Unity.Deformations
public struct BlendShapeWeight : IBufferElementData
{
/// <summary>
/// The weight value of the blend shape.
/// The weight value of the blend shape. The range is from `0.0f` to `100.0f`, where `0.0f` is 0% and `100.0f` is 100%.
/// </summary>
public float Value;
}
Expand Down
Loading

0 comments on commit 55ca11e

Please sign in to comment.