What's new in Entities 1.4
This section contains information about new features, improvements, and issues fixed in Entities 1.4.
For a complete list of changes made in Entities 1.4, refer to the Changelog.
Deprecated API
In this release, the following API are marked as obsolete:
The
Entities.ForEach
andJob.WithCode
methods are marked as obsolete.Use the following API instead:
Use
IJobEntity
andSystemAPI.Query
instead ofEntities.ForEach
.Use
IJob
instead ofJob.WithCode
.
The
IAspect
interface is marked as obsolete. Use theComponent
andEntityQuery
APIs instead.The
ComponentLookup.GetRefRWOptional
andGetRefROOptional
methods are marked as obsolete. These methods were designed for Aspect source generation and were intended for internal use. UseTryGetRefRO
andTryGetRefRW
methods instead for improved safety and clarity.
All of these APIs are supported in the Entities 1.x package but will be removed in a future major release of Entities.
For more information on upgrading to Entities 1.4, refer to the upgrade guide.
Improvements
This release adds improvements in usability, performance, and workflows, while also expanding API capabilities and documentation coverage.
System Inspector window improvements:
The Queries tab now displays the following components when executing a query: Disabled, Present, Absent, and None.
Added the Dependencies tab, which displays which components a system depends on.
Query window improvement: the window highlights prefabs with appropriate icons to differentiate them from other entities.
The
WorldUnmanaged
struct now has theGetSystemTypeIndex(SystemHandle SystemHandle)
method, which lets you get theSystemTypeIndex
from aSystemHandle
.RemoteContentCatalogBuildUtility.PublishContent method improvements:
- The method now creates content sets for all objects and scenes, using the
UntypedWeakReferenceId.ToString
method as the name of the set. This enables downloading dependencies of specific objects and scenes. For subscenes, a content set is named with a GUID and contains the header, all entity section files, and any Unity object references in content archives. - The method now creates the
DebugCatalog.txt
text file containing all remapping information in the root of the remote content folder. This file shows how each file is remapped to its cache location and what itsRemoteContentId
is. It also lists all content sets defined during the Publish step. - The method now accepts an enumerable file list rather than a directory name. This ensures that content updates include only the specified files in the catalog rather than all files in a folder.
- The method now creates content sets for all objects and scenes, using the
Safe component access: The new
ComponentLookup.TryGetRefRW
andComponentLookup.TryGetRefRO
methods let you safely check if a component exists, and retrieve it from an entity in a single method call.Custom Editor enhancement: Added an
OnGUI
override in theWeakReferencePropertyDrawer
class to ensure proper display of theWeakObjectReference
,WeakObjectSceneReference
,EntitySceneReference
, andEntityPrefabReference
fields.World bootstrapping management: Added the
DisableBootstrapOverridesAttribute
attribute for types or assemblies that useICustomBootstrap
to prevent unintended bootstrap implementations.Buffer API improvements: Added methods
GetBufferAccessorRO
andGetBufferAccessorRW
to theArchetypeChunk
struct. These methods enable callers to explicitly request a specific access mode for a buffer component instead of relying on the implicit access mode of the buffer type handle. This enables users to request read-only access from a read-write buffer type handle without introducing unnecessary write dependencies.Advanced buffer handling: Added a new
GetUntypedBufferAccessorReinterpret<T>
method to theArchetypeChunk
struct, which is equivalent to the existingGetDynamicComponentDataArrayReinterpret<T>
method but is designed for buffer components. This enables you to create a compile-time-typedBufferAccessor<T>
from a runtime-typedDynamicComponentTypeHandle
, including an accessor to a different type than the one stored in the handle, in case the types are safely aliasable in memory.
Performance improvements
Optimized performance of the following methods:
SetSharedComponentManaged
,IEntitiesPlayerSettings.GetFilterSettings
.The TypeManager.Initialize method is approximately twice as fast on startup in player builds in large projects with many assemblies that don't reference
Unity.Entities.dll
.The method now does not scan all player assemblies on startup for types inheriting from
UnityEngine.Object
(for example,MonoBehaviour
,ScriptableObject
). If Unity is raising errors because a type in a project is not registered with theTypeManager
(for example, because you need to use it in a query), register it explicitly using[assembly: RegisterUnityEngineComponentType(typeof(YourParticularType))]
.Improved the performance of the
ChunkEntityEnumerator
constructor in every case except when running with argumentuseEnabledMask = false
on Mono, in which case it's about twice as slow compared to the previous version. If your application uses the constructor with such argument, use a for loop instead.
Documentation improvements
Added documentation on storing references to
UnityEngine.Object
types using theUnityObjectRef
API.Expanded documentation on the LinkedEntityGroup buffer and Transforms in entities.