-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50b11fa
commit 2d5a2ab
Showing
105 changed files
with
2,642 additions
and
876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"timestamp": 1684982863, | ||
"signature": "C1AJ/KZmfCU2V+KlhIKuCqVncKltmWYgTeBw+dJu2ZteXgegQyRkgRPLL+AhTtzT1imsYbVpJZESLInrIGWHfK7X3MJNvRa9hI5Wd1684zbfYh3BxHzWo4EzG4IgBnzW4DHbRN+3V90ro6OTAyWZQ6ULEEiZSz/Lycf4573gWuJX2ZCs+wp+Uywy/eiBl1lTU0hEaf3wyw7HC+BqwsbTGP5CyaaeKO9RoMS9T3yNKFI70wJ2+ZifKeUDXDl695Rw0hS07U4Omjt8kXfbadHha6uIHdBD8/VyLd/cUiLewWZPPW4Z2RYJZztzG1xYEVF+fMtsTgGbcUoLsze8r24RFhIhP1q1LL1s362txkQZM8vZYp+fWaOZJbujH+NXk0SPj5qxXmJSq5EcJc2JfJRvagXDd12dFb0o7yTwfe809KBu/1Udv6bJPS25e2VpUH54ZgGCOO9BnZ0JX9Ru1UbP0yor/ER3ykqlSizdfC7SIWZMxXP7y7tPQ2AOT4wVCNIL", | ||
"timestamp": 1687275887, | ||
"signature": "M7JKoAa0tgjALvTUSdFJBqYXLQ3eVvUXexPpv8F8UqgLeAaGSB3I3An1SYHYrd8+pZ7uN38wYTDr3ddf2qoBSlh/pZ7/0+qgAgEjz1CE429thGum4XWFKvGcN/JIDIrAbuKAMJEMmMLG+0pEGoknWx8L12po69j+twPCPVmF9KNayrJaVjUodSmzu2v5EOa+8bwVHkpebTAaM8cPa4CWagQEcMjWUPYK1fRuy6Gssr+wcQwqkdy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lROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Unity.Entities; | ||
using Unity.Collections; | ||
|
||
namespace Doc.CodeSamples.Tests | ||
{ | ||
public struct Health : IComponentData, IEnableableComponent | ||
{ | ||
public float Value; | ||
} | ||
|
||
public struct Translation : IComponentData, IEnableableComponent | ||
{ | ||
|
||
} | ||
|
||
#region enableable-example | ||
public partial struct EnableableComponentSystem : ISystem | ||
{ | ||
|
||
public void OnUpdate(ref SystemState system) | ||
{ | ||
|
||
Entity e = system.EntityManager.CreateEntity(typeof(Health)); | ||
|
||
ComponentLookup<Health> healthLookup = system.GetComponentLookup<Health>(); | ||
|
||
// true | ||
bool b = healthLookup.IsComponentEnabled(e); | ||
|
||
// disable the Health component of the entity | ||
healthLookup.SetComponentEnabled(e, false); | ||
|
||
// though disabled, the component can still be read and modified | ||
Health h = healthLookup[e]; | ||
|
||
} | ||
|
||
} | ||
#endregion | ||
|
||
#region enableable-health-example | ||
public partial struct EnableableHealthSystem : ISystem | ||
{ | ||
|
||
public void OnUpdate(ref SystemState system) | ||
{ | ||
|
||
Entity e1 = system.EntityManager.CreateEntity(typeof(Health), typeof(Translation)); | ||
Entity e2 = system.EntityManager.CreateEntity(typeof(Health), typeof(Translation)); | ||
|
||
// true (components begin life enabled) | ||
bool b = system.EntityManager.IsComponentEnabled<Health>(e1); | ||
|
||
// disable the Health component on the first entity | ||
system.EntityManager.SetComponentEnabled<Health>(e1, false); | ||
|
||
EntityQuery query = new EntityQueryBuilder(Allocator.Temp).WithAll<Health, Translation>().Build(ref system); | ||
|
||
// the returned array does not include the first entity | ||
var entities = query.ToEntityArray(Allocator.Temp); | ||
|
||
// the returned array does not include the Health of the first entity | ||
var healths = query.ToComponentDataArray<Health>(Allocator.Temp); | ||
|
||
// the returned array does not include the Translation of the first entity | ||
var translations = query.ToComponentDataArray<Translation>(Allocator.Temp); | ||
|
||
// This query matches components whether they're enabled or disabled | ||
var queryIgnoreEnableable = new EntityQueryBuilder(Allocator.Temp).WithAll<Health, Translation>().WithOptions(EntityQueryOptions.IgnoreComponentEnabledState).Build(ref system); | ||
|
||
// the returned array includes the Translations of both entities | ||
var translationsAll = queryIgnoreEnableable.ToComponentDataArray<Translation>(Allocator.Temp); | ||
|
||
} | ||
|
||
|
||
} | ||
#endregion | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.