Class LDtkIidComponentBank
Unlike LDtkIidBank, this contains components in the scene, and used for referencing in runtime.
This is also fully accessible during the import process.
Note: If there are duplicated instances of a GameObject with an iid component, it may result in inconsistent references.
Methods
| Improve this Doc View SourceFindObjectOfIid(String)
Finds an iid component.
Parameters
Type | Name | Description |
---|---|---|
System.String | iid | The iid value. |
Returns
Type | Description |
---|---|
LDtkIid | The iid component that matches the iid. |
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 GetByIid(String) 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.
GetByIid(String)
Gets an iid GameObject. The objects are only available after their OnEnable. Otherwise, try using FindObjectOfIid(String).
If the component was not found, then make sure the referenced component is active and accessed after it's OnEnable.
Parameters
Type | Name | Description |
---|---|---|
System.String | iid | The iid value. |
Returns
Type | Description |
---|---|
LDtkIid | The iid component that matches the iid. |