Class LDtkReferenceToAnEntityInstance
This object describes the "location" of an Entity instance in the project worlds.
Properties
| Improve this Doc View SourceEntityIid
Type | Description |
---|---|
System.String |
LayerIid
Type | Description |
---|---|
System.String |
LevelIid
Type | Description |
---|---|
System.String |
WorldIid
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceFindEntity()
Finds the iid Entity GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component of this entity reference |
Remarks
This function uses Object.FindObjectsOfType if a cached component is not found, so it is slow and not recommended to use every frame. However if the object is found, it is cached.
In most cases you can use GetEntity() instead as long as the object you are looking for is active. If the object you are looking for is inactive, you can try this.
FindLayer()
Finds the iid Layer GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component of this entity reference |
Remarks
This function uses Object.FindObjectsOfType if a cached component is not found, so it is slow and not recommended to use every frame. However if the object is found, it is cached.
In most cases you can use GetLayer() instead as long as the object you are looking for is active. If the object you are looking for is inactive, you can try this.
FindLevel()
Finds the iid Level GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component of this entity reference |
Remarks
This function uses Object.FindObjectsOfType if a cached component is not found, so it is slow and not recommended to use every frame. However if the object is found, it is cached.
In most cases you can use GetLevel() instead as long as the object you are looking for is active. If the object you are looking for is inactive, you can try this.
FindWorld()
Finds the iid World GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component of this entity reference |
Remarks
This function uses Object.FindObjectsOfType if a cached component is not found, so it is slow and not recommended to use every frame. However if the object is found, it is cached.
In most cases you can use GetWorld() instead as long as the object you are looking for is active. If the object you are looking for is inactive, you can try this.
GetEntity()
Gets a iid GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component that matches the iid. |
Remarks
The objects are only available after their OnEnable. Otherwise, try using FindEntity().
If the iid component exists but this returned null, then make sure the referenced component is active and accessed after it's OnEnable.
GetLayer()
Gets a iid GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component that matches the iid. |
Remarks
The objects are only available after their OnEnable. Otherwise, try using FindLayer().
If the iid component exists but this returned null, then make sure the referenced component is active and accessed after it's OnEnable.
GetLevel()
Gets a iid GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component that matches the iid. |
Remarks
The objects are only available after their OnEnable. Otherwise, try using FindLevel().
If the iid component exists but this returned null, then make sure the referenced component is active and accessed after it's OnEnable.
GetWorld()
Gets a iid GameObject.
Returns
Type | Description |
---|---|
LDtkIid | The iid component that matches the iid. |
Remarks
The objects are only available after their OnEnable. Otherwise, try using FindWorld().
If the iid component exists but this returned null, then make sure the referenced component is active and accessed after it's OnEnable.