Skip to content

Commit c1fe55e

Browse files
Merge branch 'master' into documentation
2 parents da94355 + 80aee56 commit c1fe55e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Runtime/EntityComponent.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public void SetActive (bool value) =>
4848
/// Destroys the game object of the entity.
4949
public void Destroy () =>
5050
UnityEngine.Object.Destroy (this.gameObject);
51+
52+
/// Gets a component on an enity and sets it's reference to a property.
53+
public void GetComponentToProperty<UnityComponentType> (ref UnityComponentType entityProperty, bool includeChildren = false, bool includeInactive = false) =>
54+
entityProperty = includeChildren == true
55+
? this.GetComponentInChildren<UnityComponentType> (includeInactive)
56+
: this.GetComponent<UnityComponentType> ();
5157

5258
/// Adds an asset to the entity.
5359
public UnityEngine.Object AddAsset (UnityEngine.Object asset) =>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nl.elraccoone.entity-component-system",
33
"displayName": "Entity Component System",
4-
"version": "3.7.0",
4+
"version": "3.7.1",
55
"unity": "2019.1",
66
"description": "A better approach to game design that allows you to concentrate on the actual problems you are solving: the data and behavior that make up your game. By moving from object-oriented to data-oriented design it will be easier for you to reuse the code and easier for others to understand and work on it."
77
}

0 commit comments

Comments
 (0)