Skip to content

Commit

Permalink
Merge pull request #221 from sakano/docs/fix-typo
Browse files Browse the repository at this point in the history
[docs] Fix some sample codes in document
  • Loading branch information
hadashiA committed May 12, 2021
2 parents ef7e264 + baef1de commit a6d4c86
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions website/docs/registering/register-monobehaviour.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ builder.RegisterComponentInHierarchy<YourBehaviour>()
## Register component to specific parent Transform

```csharp
// Instantiate under the specified transform
builder.RegisterComponentFromInNewPrefab<YourBehaviour>(Lifetime.Scoped)
// 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.
Expand All @@ -66,7 +70,7 @@ builder.RegisterComponentInHierarchy<YourBehaviour>()
Or find at runtime.

```csharp
builder.RegisterComponentFromInNewPrefab<YourBehaviour>(Lifetime.Scoped)
builder.RegisterComponentOnNewGameObject<YourBehaviour>(Lifetime.Scoped)
.UnderTransform(() => {
// ...
return parent;
Expand Down

1 comment on commit a6d4c86

@vercel
Copy link

@vercel vercel bot commented on a6d4c86 May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.