com.unity.entities 1.0.10

com.unity.entities

Source docs
Notes: processedReleased May 25, 2023

Browse versions

PreviousNext

Unity Compatibility

Minimum Unity: 2022.2 (15f1)

Package Dependencies

Features

  • Write a WebGLPreloadedStreamingAssets.manifest file into the Library/PlayerDataCache folder for webgl builds containing all files in the streaming asset folder to be preloaded at runtime by the webgl player build program.
  • Added IsReferenceValid property to EntityPrefabReference and EntitySceneReference.
  • Added `EntityManager.AddComponentData(SystemHandle, T)` for managed components.

📈 Improvements

  • Significantly optimized bulk-structural change operations in `EntityManager`, including:
  • `EntityManager.AddComponent(EntityQuery)`
  • `EntityManager.AddComponent(EntityQuery, ComponentType)`
  • `EntityManager.AddComponent(EntityQuery, ComponentTypeSet)`
  • `EntityManager.RemoveComponent(EntityQuery)`
  • `EntityManager.RemoveComponent(EntityQuery, ComponentType)`
  • `EntityManager.RemoveComponent(EntityQuery, ComponentTypeSet)`
  • `EntityManager.AddSharedComponent(EntityQuery, T)`
  • `EntityManager.AddSharedComponentManaged(EntityQuery, T)`
  • `EntityManager.DestroyEntity(EntityQuery)` is now up to 4x faster in release builds.
  • Added analyzer to detect several ways an "Entities.ForEach" or "Job.WithCode" chain can be malformed.

API Changes

  • Entities.ForEach and Job.WithCode now generate an error if their lambda contains other lambdas or local functions. This never fully worked or was fully implemented. Instead, try using APIs, like SystemAPI.Query, IJobEntity and IJobChunk. These all work with both local functions and lambdas.

🔧 Bug Fixes

  • SystemAPI methods now work inside of partial methods.
  • All aspect generated type references to their full name beginning with `global::` (Type Shadowing)
  • Do not generate aspect from type with shadowed IAspect type
  • Fixed sourcegen issues with user types and namespaces that conflict with Unity and Entities types.
  • Identically named types in different namespaces no longer trigger `CS0128` and `CS1503` when used as parameters in `IJobEntity.Execute()`.
  • If you update multiple packages, create a new section with a new header for the other package.
  • Assets loaded in edit mode through the content system are not forcibly unloaded.
  • LocalToWorld.Transform now works with nonuniform scale
  • Introduce clear error message (`SGJE0023`) when parameter types in `IJobEntity.Execute()` methods are less accessible than the `IJobEntity` types in which they are used.
  • `EntityCommandBuffer.AddComponent(Entity)` for managed `T` no longer leaves the managed component store in an invalid state.
  • The constructor for `ComponentTypeSet` no longer throws an exception if the provided list of component types is empty.
  • `EntityManager.AddSharedComponent(EntityQuery,T)` and `EntityManager.AddSharedComponentManaged(EntityQuery,T)`now set the shared component `T` to the provided value, even if the target chunk already has component `T`. This changes makes this method consistent with other "add component and set to value" operations. *All existing call sites should be reviewed to ensure that they're not relying on the function's previous behavior!*
  • `EntityManager.DestroyEntity(EntityQuery)` had an undocumented constraint: if any of the target entities have a `LinkedEntityGroup` buffer component, the entities in that buffer must also match the target query. This constraint is now documented, and consistently applied in all code paths of this function.
  • You now can register generic ISystems so that they can be discovered and created automatically with world creation, or created manually via CreateSystem. Register each generic instance of them with `[assembly: RegisterGenericSystemType(typeof(YourGenericSystem))]` to allow such usage.

⚠️ Known Issues

  • Some errors are surfaced when importing the Entities package into a 2D project. To bypass this issue, restart the editor once the package has been imported.