You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EntitiesSamples/Docs/additional-entities-features.md
-4
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,6 @@ For instance, the `EntityManager` has these key methods:
39
39
| :- |
40
40
| For the sake of the job safety checks, read or write access of a component's enabled state requires read or write access of the component type itself. |
41
41
42
-
🕹*[See examples of checking and setting the enabled state of components](./examples/components_systems.md#enableable-components).*
43
-
44
42
In an `IJobChunk`, the `Execute` method parameters signal which entities in the chunk match the query:
45
43
46
44
- If the `useEnableMask` parameter is false, all entities in the chunk match the query.
@@ -50,8 +48,6 @@ In an `IJobChunk`, the `Execute` method parameters signal which entities in the
50
48
| :- |
51
49
| The `chunkEnabledMask` is a *composite* of all the enabled states of the enableable components included in the query of the job. To check enabled states of individual components, use the `IsComponentEnabled()` and `SetComponentEnabled()` methods of the `ArchetypeChunk`. |
52
50
53
-
🕹*[See an example `IJobChunk` that correctly accounts for disabled components](./examples/jobs.md#ijobchunk).*
Copy file name to clipboardExpand all lines: EntitiesSamples/Docs/baking.md
+2-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Baking and entity scenes
2
2
3
+
🕹*[See examples of baking and authoring components](../Assets/ExampleCode/Baking.cs).*
4
+
3
5
**Baking** is a build-time process that transforms **sub scenes** into **entity scenes** using **bakers** and **baking systems**:
4
6
5
7
- A **sub scene** is a Unity scene asset that's embedded in another scene by the [SubScene](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.SubScene.html) MonoBehaviour.
@@ -13,8 +15,6 @@ Baking a sub scene is done in a few main steps:
13
15
2. The baker of each authoring component in the sub scene is executed. Each baker can read the authoring component and add components to the corresponding entity.
14
16
2. The baking systems execute. Each system can read and modify the baked entities in any way: set components, add components, remove components, create additional entities, or destroy entities. Unlike bakers, baking systems should not access the original GameObjects of the sub scene.
15
17
16
-
🕹*[See examples of authoring components, bakers, and baking systems.](./examples/baking.md)*
17
-
18
18
When modified, a sub scene is re-baked:
19
19
20
20
1. Only the bakers that read the modified authoring components are re-executed.
@@ -70,8 +70,6 @@ The [`SceneSystem`](https://docs.unity3d.com/Packages/com.unity.entities@latest?
70
70
|[`GetScenePath()`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.ICleanupComponent.html)| Returns the path of a scene asset (specified by its GUID). |
71
71
|[`GetSceneEntity()`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.ICleanupComponent.html)| Returns the entity representing a scene (specified by its GUID). |
72
72
73
-
🕹*[See examples of loading and unloading entity scenes and sections.](./examples/baking.md#scene-loading)*
74
-
75
73
|⚠ IMPORTANT |
76
74
| :- |
77
75
| Entity scene and section loading is always asynchronous, and there is no guarantee of how long it will take for the data to be loaded after the request. In most cases, code should check for the presence or absence of specific data loaded from scenes rather than check the loading status of the scenes themselves. This approach avoids tethering code to particular scenes: if the data is moved to a different scene, downloaded from the network, or procedurally generated, the code will still work without modification. |
Copy file name to clipboardExpand all lines: EntitiesSamples/Docs/entities-components.md
+1-10
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ A component type defined with `IComponentData` or `IBufferElementData` can be ma
41
41
42
42
A [`World`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.World.html) is a collection of entities. An entity's ID number is only unique within its own world, *i.e.* the entity with a particular ID in one world is entirely unrelated to an entity with the same ID in a different world.
43
43
44
-
A world also owns a set of [systems](concepts-systems.md), which are units of code that run on the main thread, usually once per frame. The entities of a world are normally only accessed by the world's systems (and the jobs scheduled by those systems), but this is not an enforced restriction.
44
+
A world also owns a set of [systems](concepts-systems.md), which are units of code that run on the main thread, usually once per frame. The entities of a world are normally only accessed by the world's systems and the jobs scheduled by those systems, but this is not an enforced restriction.
45
45
46
46
The entities in a world are created, destroyed, and modified through the world's [`EntityManager`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.EntityManager.html). Key `EntityManager` methods include:
47
47
@@ -118,9 +118,6 @@ An [`EntityQuery`](https://docs.unity3d.com/Packages/com.unity.entities@latest?s
118
118
119
119
A query can also specify component types to *exclude* from the matching archetypes. For example, if a query looks for all entities having component types *A* and *B* but *not* having component type *C*, the query would match entities with component types *A* and *B*, but the query would *not* match entities with component types *A*, *B*, and *C*.
120
120
121
-
🕹*[See examples of creating and using queries](./examples/components_systems.md#querying-for-entities).*
122
-
123
-
124
121
<br>
125
122
126
123
# Entity ID's
@@ -139,8 +136,6 @@ In order to allow entity indexes to be reused after an entity is destroyed, each
139
136
140
137
The most common, basic kind of component type is defined as a struct implementing [`IComponentData`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.IComponentData.html).
141
138
142
-
🕹*[See examples of creating and using `IComponentData` components.](./examples/components_systems.md#icomponentdata)*
143
-
144
139
An `IComponentData` struct is expected to be unmanaged, so it cannot contain any managed field types. Specifically, the allowed field types are:
@@ -175,8 +170,6 @@ If a managed component type implements `ICloneable`, then any resources it conta
175
170
176
171
A [`DynamicBuffer`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.DynamicBuffer-1.html) is a component type which is a resizable array. To define a `DynamicBuffer` component type, create a struct that implements the [`IBufferElementData`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.IBufferElementData.html) interface.
177
172
178
-
🕹*[See examples of creating and using `DynamicBuffer` components](./examples/components_systems.md#dynamicbuffers-ibufferelementdata).*
179
-
180
173
The buffer of each entity stores a `Length`, a `Capacity`, and a pointer:
181
174
182
175
* The `Length` is the number of elements in the buffer. It starts at `0` and increments when you append a value to the buffer.
@@ -224,8 +217,6 @@ A `DynamicBuffer<T>` can be '[reinterpreted](https://docs.unity3d.com/Packages/c
224
217
225
218
An aspect is an object-like wrapper over a subset of an entity's components. Aspects can be useful for simplifying queries and component-related code. The [`TransformAspect`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Transforms.TransformAspect.html), for example, groups together the standard transform components ([`LocalTransform`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Transforms.LocalTransform.html), [`ParentTransform`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Transforms.ParentTransform.html), and [`WorldTransform`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Transforms.WorldTransform.html)).
226
219
227
-
🕹*[See examples of creating and using aspects](./examples/components_systems.md#aspects)*.
228
-
229
220
Including an aspect in a query is the same as including the components wrapped by the aspect, *e.g.* a query that includes `TransformAspect` includes the standard transform matrix components.
230
221
231
222
An aspect is defined as a readonly partial struct implementing [`IAspect`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.IAspect.html). The struct can contain fields of these types:
Copy file name to clipboardExpand all lines: EntitiesSamples/Docs/entities-jobs.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,12 @@
1
-
2
1
# Accessing entities in jobs
3
2
3
+
🕹*[See example jobs](../Assets/ExampleCode/Jobs.cs).*
4
+
4
5
You can offload the processing of entity data to worker threads with the [C# Job System](https://docs.unity3d.com/Manual/JobSystem.html). The Entities package has two interfaces for defining jobs that access entities:
5
6
6
7
-[`IJobChunk`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.IJobChunk.html), whose `Execute()` method is called once for each individual chunk matching the query.
7
8
-[`IJobEntity`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.IJobEntity.html), whose `Execute()` method is called once for each entity entity matching the query.
8
9
9
-
🕹*[See examples of IJobChunk](./examples/jobs.md#ijobchunk)[and IJobEntity](./examples/jobs.md#ijobentity).*
10
-
11
10
Although `IJobEntity` is generally more convenient to write and use, `IJobChunk` provides more precise control. In most cases, their performance is identical for equivalent work.
Copy file name to clipboardExpand all lines: EntitiesSamples/Docs/entity-command-buffers.md
-4
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,6 @@ An `EntityCommandBuffer` has many (but not all) of the same methods as `EntityMa
17
17
|[`AddBuffer()`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.EntityCommandBuffer.AddBuffer.html)| Returns a `DynamicBuffer` which is stored in the recorded command, and the contents of this buffer will be copied to the entity's actual buffer when it is created in playback. Effectively, writing to the returned buffer allows you to set the initial contents of the component. |
18
18
|[`SetBuffer()`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.EntityCommandBuffer.SetBuffer.html)| Like `AddBuffer()`, but it assumes the entity already has a buffer of the component type. In playback, the entity's already existing buffer content is overwritten by the contents of the returned buffer. |
19
19
20
-
🕹*[See examples of creating and using an `EntityCommandBuffer`](./examples/jobs.md#ijobchunk).*
21
-
22
20
|📝 NOTE |
23
21
| :- |
24
22
| Some `EntityManager` methods have no `EntityCommandBuffer` equivalent because an equivalent wouldn’t be feasible or make sense. For example, there are no `EntityCommandBuffer` methods for getting component values because *reading* data is not something that can be usefully deferred. |
@@ -82,8 +80,6 @@ If an `EntityCommandBuffer` is created with the `PlaybackPolicy.MultiPlayback` o
82
80
83
81
An [`EntityCommandBufferSystem`](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/api/Unity.Entities.EntityCommandBufferSystem.html) is a system that provides a convenient way to defer `EntityCommandBuffer` playback. An `EntityCommandBuffer` instance created from an `EntityCommandBufferSystem` will be played back and disposed the next time the `EntityCommandBufferSystem` updates.
84
82
85
-
🕹*[See examples of creating and using an `EntityCommandBufferSystem`](./examples/components_systems.md#entitycommandbuffersystems).*
86
-
87
83
You rarely need to create any `EntityCommandBufferSystem`'s yourself because the automatic bootstrapping process puts these five into the default world:
0 commit comments