Skip to content

Commit

Permalink
[website] Add examples for RegisterComponentHierarchy().UnderTransform()
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Feb 8, 2021
1 parent 0eb3262 commit fedbe7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions website/docs/registering/register-monobehaviour.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ builder.RegisterComponentInHierarchy<YourBehaviour>()
## Register component to specific parent Transform

```csharp
// Instantiate under the specified transform
builder.RegisterComponentFromInNewPrefab<YourBehaviour>(Lifetime.Scoped)
.UnderTransform(parent);

// Find the component under the specified transform.
builder.RegisterComponentInHierarchy<YourBehaviour>()
.UnderTransform(parent);
```

Or find at runtime.
Expand Down

0 comments on commit fedbe7e

Please sign in to comment.