Skip to content

Commit

Permalink
Add version 1.1.0-exp.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleptine committed Oct 12, 2023
1 parent 96c3714 commit 6c1d542
Show file tree
Hide file tree
Showing 626 changed files with 20,001 additions and 20,740 deletions.
4 changes: 4 additions & 0 deletions .buginfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
system: jira
server: jira.unity3d.com
project: ECSB
issuetype: Bug
1 change: 1 addition & 0 deletions .footignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ValidationExceptions.json
4 changes: 2 additions & 2 deletions .signature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timestamp": 1691186202,
"signature": "orgNrb50nSC/yL81htPYIx/n/dIJgdgaUT/2X+lpf7zjp6/w5nFhiJQpsoL1tQV/WQvTZvPagdTqVXrMRccwBXMIxg/GEER3A/cArroxl+ti5tTIzN08wwrk2z+pPO03cSCaqLHjt3IkGUeT7p366RouIL98uGIO2jY3eSFJEWZkMyZ1Zp4OoR7mmStvnZyU5HUlbujR28pHrtKGSSLuA3fAKiF212jHD8UkAePwUbsKhSxgp9L7oFT16wWbt3eK8R5Wx3m7tA14978EbeQCOlFybEAhpytxBxK7OcuxPJyJ9SSBZ/vOW/EH4b/bMB5375LZ47SIG6eouuGB/PW69yNzXeGP5Lq6QIE8ZCiVwZDQcqW/3fFmiVb0hloZ3dgenOVG6mAjXSOQ9/DwwfJE7SlkjxFP34lM2IsIIus159dREzwF05E28/ZLBBZjucJpZhLyH8tEYzYjjSnoI0/8ML1vnaRfs+OZoZdo/zqSxDUClmCE7XqDioAnuig9Eh1X",
"timestamp": 1695065981,
"signature": "YCV6QPUtvkYAXfuH8MSnha1DV0VKCUX7pdD+1SqL9NHY76MFodRJFHcVYHQMmSEd8YCcafP/2haJRw9i68/eMBBC+kekI+96VyY5WtUZvwmDGJPRbZke7lCT/UQ3bdFsRaWuUwXfsbJ0aZeyVEu5UMVoTNoCtt1wS2WrUK/gqXn4fGbp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b0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"
}
109 changes: 105 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,110 @@
# Changelog

## [1.1.0-exp.1] - 2023-09-18

### Added

* Added a "Custom Transform System" folder in the assets folder of the "EntitiesSamples" project.
* missing documentation on search public api
* Enabled model assets to be baked as prefabs using EntityPrefabReference.
* Error DC0084 is generated when capturing a local variable in an Entities.ForEach that isn't used.
* Add GetSharedComponentIndexManaged API
* Added addition errors around improper use of SystemAPI methods with generic type arguments.
* Search Keyword registration for entities preferences and settings.
* `SystemAPI.Query<T>` now supports `WithSharedComponentFilterManaged<T>(T sharedComponent)` and `WithSharedComponentFilterManaged<T1, T2>(T1 sharedComponent1, T2 sharedComponent2)`.
* `CompleteDependencyBeforeRW(SystemState state)` and `CompleteDependencyBeforeRO(SystemState state)` are added to the public `Unity.Entities.IAspectCreate<T>` interface in order to faciltiate changes to source-generated code. Implementations of these methods, like all existing methods in `Unity.Entities.IAspectCreate<T>`, will automatically be generated on users' behalf by source generators.
* Added `IBaker.CreateAdditionalEntities` for creating multiple additional entities at once.
* filter to search with SharedComponent from within the Hierarchy Window
* filter to search with SharedComponent from within the Search Window
* New `EntityQuery` component type constraint: `Present` components are required to be present on a query's matching archetypes, whether or not they are enabled or disabled on individual entities. This constraint can be added in all the usual places -- `EntityQueryBuilder.WithPresent<T>()`, `EntityQueryDesc.Present[]`, the `[WithPresent(typeof(T))]` attribute on `IJobEntity`, etc.
* checks to see if an exclusive transaction is active while scheduling a job.
* Specific error when capturing a variable in `Entities.ForEach` that relies on relies on source generators (since there is no deterministic order between source generators, this can be an error).

### Changed

* Significantly improved the performance of `EntityManager.SetSharedComponent<T>(EntityQuery,T)` and `EntityManager.SetSharedComponentManaged<T>(EntityQuery,T)`
* `TypeManager.Initialize` will disable synchronous Burst compilation only during initialization of the TypeManager so that large synchronous compilation stalls when compiling function pointers can be avoided when iterating in the Editor.
* BlobBuilder is now partial
* CompanionGameObjectUpdateTransformSystem is now public
* ResetUpdateAllocator is now public
* SubSceneInspectorUtility is now public
* Batch primary entity creation in baking.
* `HasSingleton<T>()` and `TryGetSingleton<T>()` methods will now throw if they find >1 instance of `T`, instead of returning `false`. Having more than one instance of a singleton component indicates a bug in the program, and should fail more obviously.
* The visibility of the `EnabledBitUtility` class was changed from `public` to `internal`. This class was never intended to be part of the public API of the Entities package, and should not be used by application code.
* `EntityManager.AddChunkComponentData(EntityQuery,T)` no longer throws an exception if the component `T` is already present on any of the target chunks. Instead, the new value is assigned to the existing component. This matches the behavior of other AddComponent variants in the Entities package.
* Text for exception that occurs when an entity doesn't exist during EntityCommandBuffer playback.
* `IJobChunk` now allows indexed writes to native containers passed in the job struct. Only writes to the element at `unfilteredChunkIndex` are valid. To disable this check on a per-container basis, add `[NativeDisableParallelForRestriction]` to the relevant field in the job struct.

### Deprecated

* Deprecate GetSharedComponentDataIndex as it is a dupplicate of GetSharedComponentIndex

### Removed

* Removed gizmo rendering logic for entities from C#, now this is handled natively in Unity.
* Marked `EntityManager.Instantiate(NativeArray<Entity> srcEntities, NativeArray<Entity> outputEntities)` as obsolete, with the intention to eventually remove it entirely.

### Fixed

* Code fix now available to rewrite offending code that trigger `CS1654` errors.
* Fixed a typo in the "LocalTransform" summary comment.
* Property drawer for arrays and lists of Weak(Object|Scene)Reference types
* Compilation with DISABLE_ENTITIES_JOURNALING works again.
* Ensure Component gizmos are rendered for GameObjects in SubScenes when rendered with Entities. That is when using Preferences->Entities->SceneView Mode -> Runtime Data.
* Added null checks in BlobAssetReferenceData properties to avoid crashing the engine while inspecting variables with the debugger.
* LocalTransform.FromMatrixSafe would throw exceptions for valid matricies
* IJobEntity overwriting files due to colliding filenames.
* Differ discards ChunkComponents added during baking.
* Fixed issue with BakingVersion(true) triggering warnings in the console log about the attribute being missing on the type you placed this on in cases where named BakingVersion attributes are being used in the containing assembly.
* A source generator error is not thrown anymore when using the fully qualified name of `SystemAPI.Time` (e.g. `Unity.Entities.SystemAPI.Time`).
* The main entity in LinkedEntityGroups were not added in incremental baking.
* Fix memory leak in the BakerEntityUsage not disposing properly the list of ReferencedEntityUsage
* Fixed `isReadOnly` being ignored in `EntityManager.GetBuffer`.
* ArgumentException on an unknown type when using the GetComponent API in a baker with an abstract type.
* Subscenes no longer redundantly rebake on recompile due to type order changes.
* Serialization of blob asset references in unmanaged shared components
* `SystemGenerator` in the source-generation solution runs in ~48% less time when tested on a small game project shared by one of our users.
* You now no longer get a compile error for methods containing SystemAPI, EFE, or IJE scheduling, that include a signature with nullables, multiple generics, or parameter modifiers.
* KeyNotFoundException thrown by the Entities.Editor.HierarchyWindow when loading a new gameobject scene
* Users can now specify duplicate components in the same `IJobEntity.Execute()` method, insofar as exactly one of them is wrapped in `EnabledRef<T>`.
* Fixed issue where ambiguous types used in a `SystemAPI.Query<T>()` call would generate a compiler error from source generators.
* Entities Hierarchy: when entering playmode without fast enter playmode the hierarchy was showing the authoring datamode content even though the switch in the window header was showing the mixed datamode.
* Validation for world's existence before accessing within EntityContainer and EntitySelectionProxy.


## [1.0.16] - 2023-09-11

### Added

* checks to see if an exclusive transaction is active while scheduling a job.

### Changed

* Clarified in TransformHelpers API documentation that matrices are expected to be affine.
* Updated Burst dependency to version 1.8.8

### Removed

* Alignment attribute is removed when displaying component attributes in Inspector window.
* Changelog entry for * Added `EntityCommandBuffer.MoveComponent<T>(Entity src, Entity dst)` this will be added in an upcoming minor version.

### Fixed

* Companion objects appearing in the GameObject hierarchy for a frame
* `SystemAPI.Query<EnabledRefRW<MyEnabledComponent>>()` can now be used with `.WithNone<MyEnabledComponent>()`, `.WithAny<MyEnabledComponent>()` and `.WithDisabled<MyEnabledComponent>()`.
* "AssetDatabase.RegisterCustomDependency are restricted during importing" exception thrown by the EntityClientSetting in the OnDisable method, when using 2023.2 or newer.
* The entities journaling window will no longer show an error when a system handle cannot be resolved; this is not an error and simply means that no system was executing when that event was recorded.
* Search window for Systems now shows results from all the worlds instead of default ones.
* Special handling for prefab entity instantiated from prefab asset at runtime.
* Entities Hierarchy: fix an issue that can happen when copying scene entities from different worlds.
* Entities Hierarchy: Fix memory leak in hierarchy backend.
* Entities Hierarchy: Only remove subscene nodes when they are actually not used anymore.
* Fixed `isReadOnly` being ignored in `EntityManager.GetBuffer`.
* Save unsaved opened scenes in the Editor before building a player. (fix issue: Error building Player: InvalidOperationException: ContentCatalogBuildUtility.BuildContentArchives failed with status 'UnsavedChanges')
* Fixed memory leak in some cases when an `EntityCommandBuffer` containing `DynamicBuffer` commands was disposed before it was played back.
* `World.AddSystemManaged<T>(T system)` no longer throws an exception if the system type `T` is not registered. Instead, it registers the type just in time. This matches the existing behavior of `World.CreateSystemManaged()`.
* Fixed a hash mismatch on DependOnParentTransformHierarchy


## [1.0.14] - 2023-07-27

Expand All @@ -21,7 +126,6 @@
* Increased allocation size in RuntimeContentManager initialization
* More informative error message in WriteSceneHeader()


### Removed

* Alignment attribute is removed when displaying component attributes in Inspector window.
Expand Down Expand Up @@ -175,8 +279,6 @@

### Fixed

* Allow components to contain NativeContainers whose element type is or contains a NativeContainer. Previously the TypeManager would throw during initialization if a component contained a a nested NativeContainer field. Note: NativeContainers still cannot be verified to be safely accessed when used in jobs. Thus, if a component contains a nested NativeContainer field, that component can only be accessed from the main thread.
* Fixed memory leak in content loading system when scenes are unloaded before fully loading.
* Allow components to contain NativeContainers whose element type is or contains a NativeContainer. Previously the TypeManager would throw during initialization if a component contained a a nested NativeContainer field. Note: NativeContainers still cannot be verified to be safely accessed when used in jobs. Thus, if a component contains a nested NativeContainer field, that component can only be accessed from the main thread.
* improved error message when `EntityQuery.GetSingleton()` fails
* Query window minimum size and scrolling behavior.
Expand Down Expand Up @@ -321,7 +423,6 @@
* Stripping (e.g. on IL2CPP) now won't strip whole assemblies that have important systems, like graphics.
* Generic systems created at runtime no longer break sorting functionality.


## [1.0.0-pre.44] - 2023-02-13

### Added
Expand Down
19 changes: 8 additions & 11 deletions DocCodeSamples.Tests/EntityQueryExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,18 +382,15 @@ protected override void OnCreate()

protected override void OnUpdate()
{
// Only iterate over entities that have the SharedGrouping data set to 1
// By default (without a filter), count all entities that have the required components.
query.ResetFilter();
int unfilteredCount = query.CalculateEntityCount();
// With a filter, only entities in chunks that have SharedGrouping=1 will be counted.
query.SetSharedComponentFilter(new SharedGrouping { Group = 1 });

var positions = query.ToComponentDataArray<ObjectPosition>(Allocator.Temp);
var displacements = query.ToComponentDataArray<Displacement>(Allocator.Temp);

for (int i = 0; i < positions.Length; i++)
positions[i] =
new ObjectPosition
{
Value = positions[i].Value + displacements[i].Value
};
int filteredCount = query.CalculateEntityCount();
// Many query methods include a variant that ignores any active filters. These variants are generally
// more efficient, and should be used when conservative upper-bound results are acceptable.
int ignoreFilterCount = query.CalculateEntityCountWithoutFiltering();
}
}

Expand Down
5 changes: 4 additions & 1 deletion Documentation~/baking-prefabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ To instantiate prefabs that are referenced in components, use an [`EntityManager

[!code-cs[InstantiateEmbeddedPrefabs](../DocCodeSamples.Tests/BakingPrefabExamples.cs#InstantiateEmbeddedPrefabs)]

> [!NOTE]
> Instanced prefabs will contain a [SceneSection component](streaming-scene-sections.md#entity-prefabs-and-sections). This could affect the lifetime of the entity.
To instantiate a prefab referenced with `EntityPrefabReference`, you must also add the [`RequestEntityPrefabLoaded`](xref:Unity.Scenes.RequestEntityPrefabLoaded) struct to the entity. This is because Unity needs to load the prefab before it can use it. `RequestEntityPrefabLoaded` ensures that the prefab is loaded and the result is added to the `PrefabLoadResult` component. Unity adds the [`PrefabLoadResult`](xref:Unity.Scenes.PrefabLoadResult) component to the same entity that contains the `RequestEntityPrefabLoaded`.

[!code-cs[InstantiateLoadedPrefabs](../DocCodeSamples.Tests/BakingPrefabExamples.cs#InstantiateLoadedPrefabs)]
Expand All @@ -47,4 +50,4 @@ To destroy a prefab instance, use an [`EntityManager`](xref:Unity.Entities.Entit

## Additional resources

* [Baker overview](baking-baker-overview.md)
* [Baker overview](baking-baker-overview.md)
8 changes: 7 additions & 1 deletion Documentation~/streaming-scene-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ In subscenes, ECS components can only contain references to:
>[!IMPORTANT]
> References to entities that are in a different section from the component, or aren't in section 0, are set to `Entity.Null` when they're loaded.
## Entity Prefabs and sections

All the entities in a scene have a SceneSection component that links them to a section in the scene. When that section or the scene is unloaded, all the entities with a matching SceneSection component will be unloaded too. This applies to entity prefabs as well.

When an entity prefab is instantiated, its SceneSection is added to the instanced entity. This means that unloading a scene will destroy all the prefabs instances associated with it. If this is not the desired behaviour, you can manually remove the SceneSection component from the prefab instances.

## Section loading

You can load or unload individual sections of a scene independently, but section 0 must always load first. Similarly, you can only unload section 0 once all the other sections in the scene are already unloaded.
Expand All @@ -50,4 +56,4 @@ In a similar way, to unload the content of a section, remove the component [`Uni
## Additional resources

* [Baking overview](baking-overview.md)
* [`SceneSectionComponent` API documentation](xref:Unity.Entities.SceneSectionComponent)
* [`SceneSectionComponent` API documentation](xref:Unity.Entities.SceneSectionComponent)
2 changes: 0 additions & 2 deletions Documentation~/systems-looking-up-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ uid: accessing-looking-up-data

# Look up arbitrary data


The most efficient way to access and change data is to use a [system](concepts-systems.md) with an [entity query](systems-entityquery.md) and a job. This utilizes the CPU resources in the most efficient way, with minimal memory cache misses. It's best practice to use the most efficient, fastest path to perform the bulk of data transformations. However, there are times when you might need to access an arbitrary component of an arbitrary entity at an arbitrary point in your program.


You can look up data in an entity's [`IComponentData`](xref:Unity.Entities.IComponentData) and its [dynamic buffers](components-buffer-introducing.md). The way you look up data depends on whether your code uses [`Entities.ForEach`](xref:Unity.Entities.SystemBase.Entities), or an `IJobChunk` job, or some other method on the main thread to execute in a system.

## Look up entity data in a system
Expand Down
Loading

0 comments on commit 6c1d542

Please sign in to comment.