Skip to content

Commit

Permalink
Add example of RegisterComponentInNewPrefab().UnderTransform()
Browse files Browse the repository at this point in the history
  • Loading branch information
sakano committed May 9, 2021
1 parent 7bf8f30 commit baef1de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion website/docs/registering/register-monobehaviour.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ builder.RegisterComponentInHierarchy<YourBehaviour>()
## Register component to specific parent Transform

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

// Instantiate new prefab under the specified transform
builder.RegisterComponentInNewPrefab(prefab, Lifetime.Scoped)
.UnderTransform(parent);

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

0 comments on commit baef1de

Please sign in to comment.