Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [1.0.0-pre.65] - 2023-03-21 ### Added * Added support for automatic data mode switching to the Entities Hierarchy window and the Inspector window. * Added BlobAsset safety check for passing blob assets into methods without using `ref`. * Added the `LocalTransform.ComputeWorldTransformMatrix()` which synchronously computes an entity's world-space transform matrix, in the rare cases where an accurate world transform is needed in simulation code and is otherwise be unavailable. * Added `RefRW<T> SystemAPI.GetComponentRW<T>(Entity,bool)` * Bulk SetComponentEnabled operations on EntityManager: `EntityManager.SetComponentEnabled<T>(EntityQuery, bool)` and `EntityManager.SetComponentEnabled(EntityQuery, ComponentType, bool)`. * A `Unity.Transforms.Helpers` class with assorted transform-related helper functions: * A simple `float4x4` extension methods for field extraction, such as `.Up()`, `.Forward()` and `.Translation()` * Added utilities to apply a transformation matrix to a `float3` point or direction, or to a `quaternion` rotation * A method to synchronously compute an entity's world-space transform, `.ComputeWorldTransformMatrix()` * A method to compute the "LookAt" `quaternion` rotation for a position that would cause its "forward" direction to point towards some target. * `TypeIndex.IsChunkSerializable` property has been added to identify if a component type is valid in a chunk that is intended to be serialized. If `SerializeUtility.SerializeWorld` (such as might be called while exporting a subscene) is used to serialize chunks that contain components whose `TypeIndex.IsChunkSerializable` returns false, an exception will be thrown telling you why the component type is inappropriate for serialization. * Added `WeakSceneReference Unload(Scene scene)` method to unload the scene instance and release its resources. * Added guidance to GetSingleton error message * Transform Usage Flags * Added support for managed (shared) components serialization in DOTS runtime. ### Changed * Moved the tool for adding missing `partial` keywords to system and job types from Edit > Preferences > Entities into a Roslyn codefix. Your IDE of choice should now be able to fix this for you, and give you a red squiggly line if it's missing. * IJobEntity no longer gives a compile error if you have a reference type field. This improves iteration time, and has the added benefit that you can now write managed code in an IJobEntity. Simply add a managed component to your IJE's Execute (that forces running without the jobsystem). Your job can now validly use that field. If you try to schedule this job rather than running it on the main thread, you'll correctly get thrown a runtime error for having a reference type in your job. * Improved performance of IJobEntity generator, speeding up compile times. Attributes like WithAll, WithAny etc. now use syntax information directly. This mean that you can't make your own attribute on an IJobEntity named `WithAll` `WithAny`, `WithNone`, `WithDisabled`, `WithAbsent`, `WithOptions`, or `WithChangeFilter`. * Updated Burst dependency version to 1.8.3. * What was PostTransformScale as a float3x3 is now PostTransformMatrix as a float4x4. This is more general and offers maximum flexibility. You can, for example, use it to scale from a secondary pivot. * ParentSystem removes the Parent component if said component points to an entity that doesn't exist anymore. * Refactored how additive scenes are handled within the Runtime Content Manager. A scene is now returned, and that is used as the key to unload. This change required some API changes. * Changed `WeakObjectSceneReference.LoadAsync` to return the Scene instance, which should be used to check the loading status and for unloading. * Changed `RuntimeContentManager.UnloadScene` method to take the Scene instance as the only parameter. * The BlobAssetStore used during baking now uses garbage collection instead of an explicit refcount. It is not required anymore to register blobs with authoring GameObjects nor to do explicit cleanup in incremental baking systems. * Source generators for Systems and Aspects no longer default to outputting generated files in `Temp/GeneratedCode/***`. To turn it on, add `DOTS_OUTPUT_SOURCEGEN_FILES` to your Scripting Defines in Player Settings. Turning it on will cost compilation time. (The source generator for IJobEntity already made this change earlier.) * Moved InternalCompilerInterface, EntityQueryEnumerator (now InternalEntityQueryEnumerator) and some other types and methods to the Unity.Entities.Internal namespace. These types and methods are not intended for use by user code. We would make them internal, but source generators won't work correctly that way unfortunately. ### Deprecated * Deprecated `WeakSceneReference` Release method. Unload should now be used and the scene instance returned by LoadAsync needs to be passed in as a ref. * `RegisterBindingAttribute(Type runtimeComponent, string runtimeField, bool generated)`. Vector type fields can now be registered automatically without the `generated` option. * SceneSystem.UnloadParameters and the overload of SceneSystem.UnloadScene receiving SceneSystem.UnloadParameters as parameters. * `EntityQuery.SetEnabledBitsOnAllChunks` as the only bulk operation on EntityQuery instead of EntityManager. Use the newly added bulk `SetComponentEnabled` overloads instead. * WeakSceneReference properties LoadingStatus, SceneResult, SceneFileResult. * RuntimeContentManager methods GetSceneLoadingStatus, GetSceneFileValue, GetSceneValue ### Removed * `ENABLE_TRANSFORM_V1` define and existing transform v1 code. Transform v2 is now the only transform system. * Tooling to re-write user files to add missing partial keywords to systems. * The `TransformAspect` struct was removed. Recent changes to the Entities transform systems made the current implementation of `TransformAspect` much less useful, and we've decided to remove it from the package until we can provide a more valuable abstraction over the DOTS transform components. * The `EntityQueryEnumerator.EntityCount` field has been removed from the public API. Note that `EntityQueryEnumerator` is only intended for use by DOTS source generators. * `BlobAssetComputationContext` made internal. ### Fixed * Baker IEntitiesPlayerSettings were not setup correctly if the com.unity.platforms package was not installed/present in the project. * IJobEntity now no longer caches the default query when scheduling with a dynamic query. For example. `new MyJob().Schedule();` will use the query matching its execute signature whereas `new MyJob().Schedule(myQuery)` will now only use myQuery. This is useful in cases like RequireMatchingQueriesForUpdate, where you don't want to accidentally create extra queries. * Jobs implementing IJobEntity can now be created in one assembly and scheduled in another. * The `[WithDisabled]` attribute when applied to a job implementing `IJobEntity` now overrides the implicit `All` query defined by the signature of `Execute`. E.g. `Execute(MyComp a)` and `[WithDisabled(typeof(MyComp))]` now defines a query of EntityQuery(all={}, disabled=MyComp). This is useful in cases where you want to enable all components of type X which are present, but disabled. * `WriteGroup` support in transform v2 `LocalToWorldSystem` code should now work correctly. * Fixed compilation issue with 23.1/23.2* * Detection of circular ordering dependencies between systems is now correct. * Chaining `EntityQuery` methods with bulk operation methods is now supported. * Docs and samples for ECB systems now accurately reflect recommended usage. Fixed issue during `TypeManager.Initialize` where managed components with a field containing a circular type definition may throw `ArgumentException: An item with the same key has already been added.` * Calling Release on a `WeakObjectReference<GameObject>` will no longer log errors in the editor. * Zero-sized ("tag") enableable components were not always correctly enabled by default, when added to an entire chunk (such as via `EntityManager.AddComponent<EnableableTag>(query)`). * Fixed issue with DotsGlobalSettings reporting the incorrect PlayType when switching from DedicatedServer to another standalone build target. * Fixed TypeManager initialization causing a crash in the Entities Hierarchy. * If you schedule an `IJobEntity` instance with a custom query that doesn't contain the components required for the `Execute()` method to run, a readable and actionable runtime exception is now thrown when safety checks are enabled. * `EntityCommandBuffer.Dispose()` can no longer trigger a stack overflow when disposing large command buffers. * Throw a readable, actionable compile-time error informing users that `RefRO<T>`, `RefRW<T>`, `EnabledRefRO<T>`, `EnabledRefRW<T>`, `DynamicBuffer<T>` and `UnityEngineComponent<T>` may not be used with generic types. * A `foreach` iterating over an `EntityQuery` with enableable components now iterates over the correct entities. * Re-added obsolete baker functions * The accidental exposure of package internals to "Assembly-CSharp" was reverted. * Default the build system to use the client settings if the package com.unity.netcode is not installed when the active platform is dedicated server. * `Entities.WithStructuralChanges().ForEach()` now correctly handles enableable components. * Allow components to contain nested native containers. 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. So, if a component contains a nested NativeContainer field, that component can only be accessed from the main thread. * Entities Hierarchy correctly selects the subscenes * Invalid entity warning in Inspector window with runtime data mode is only applied to entities or game objects that can be converted to entities. * Issue with IJobEntity source-generators not getting re-run in IDE. This could cause Rider and Visual Studio to not be able to find/debug generated code for IJobEntity types. * Adding managed components to entities via an `EntityCommandBuffer` on the main thread no longer triggers the `NullReferenceException`. * Fixed an issue where entities with enableable components loaded from a subscene could reference the wrong component's enabled/disabled state. * Fixed an issue where idiomatic foreach (IFE) would not iterate over all entities that matched its query, if the query contains enableable components * Issue where recompilation would retrigger baking unnecessarily.
- Loading branch information