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.ForEachandJob.WithCodemethods are marked as obsolete.Use the following API instead:
Use
IJobEntityandSystemAPI.Queryinstead ofEntities.ForEach.Use
IJobinstead ofJob.WithCode.
The
IAspectinterface is marked as obsolete. Use theComponentandEntityQueryAPIs instead.The
ComponentLookup.GetRefRWOptionalandGetRefROOptionalmethods are marked as obsolete. These methods were designed for Aspect source generation and were intended for internal use. UseTryGetRefROandTryGetRefRWmethods 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
WorldUnmanagedstruct now has theGetSystemTypeIndex(SystemHandle SystemHandle)method, which lets you get theSystemTypeIndexfrom aSystemHandle.RemoteContentCatalogBuildUtility.PublishContent method improvements:
- The method now creates content sets for all objects and scenes, using the
UntypedWeakReferenceId.ToStringmethod 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.txttext 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 itsRemoteContentIdis. 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.TryGetRefRWandComponentLookup.TryGetRefROmethods let you safely check if a component exists, and retrieve it from an entity in a single method call.Custom Editor enhancement: Added an
OnGUIoverride in theWeakReferencePropertyDrawerclass to ensure proper display of theWeakObjectReference,WeakObjectSceneReference,EntitySceneReference, andEntityPrefabReferencefields.World bootstrapping management: Added the
DisableBootstrapOverridesAttributeattribute for types or assemblies that useICustomBootstrapto prevent unintended bootstrap implementations.Buffer API improvements: Added methods
GetBufferAccessorROandGetBufferAccessorRWto theArchetypeChunkstruct. 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 theArchetypeChunkstruct, 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
ChunkEntityEnumeratorconstructor in every case except when running with argumentuseEnabledMask = falseon 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.Objecttypes using theUnityObjectRefAPI.Expanded documentation on the LinkedEntityGroup buffer and Transforms in entities.