Skip to content

Commit

Permalink
Merge pull request #706 from dmtr-t/patch-1
Browse files Browse the repository at this point in the history
Update register-monobehaviour.mdx
  • Loading branch information
hadashiA authored Nov 16, 2024
2 parents e427251 + 190c133 commit 32202fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/docs/registering/register-monobehaviour.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ builder.UseComponents(components =>
{
components.AddInstance(yourBehaviour);
components.AddInHierarchy<YourBehaviour>();
components.AddFromNewPrefab(prefab, Lifetime.Scoped);
components.AddInNewPrefab(prefab, Lifetime.Scoped);
components.AddOnNewGameObject<YourBehaviour>(Lifetime.Scoped, "name");
});
```
Expand All @@ -109,7 +109,7 @@ This is the same as:
```csharp
builder.RegisterComponent(yourBehaviour);
builder.RegisterComponentInHierarchy<YourBehaviour>();
builder.RegisterComponentFromNewPrefab(prefab, Lifetime.Scoped);
builder.RegisterComponentInNewPrefab(prefab, Lifetime.Scoped);
builder.RegisterComponentOnNewGameObject<YourBehaviour>(Lifetime.Scoped, "name");
```

Expand All @@ -122,7 +122,7 @@ builder.UseComponents(parentTransform, components =>
components.AddInHierarchy<YourBehaviour>();

// Instantiate under `parentTransform`
components.AddFromNewPrefab(prefab, Lifetime.Scoped);
components.AddInNewPrefab(prefab, Lifetime.Scoped);
components.AddOnNewGameObject<YourBehaviour>(Lifetime.Scoped, "name");
})
```
Expand All @@ -133,7 +133,7 @@ This is the same as:
builder.RegisterComponentInHierarchy<YourBehaviour>()
.UnderTransform(parentTransform);

builder.RegisterComponentFromNewPrefab(prefab, Lifetime.Scoped)
builder.RegisterComponentInNewPrefab(prefab, Lifetime.Scoped)
.UnderTransform(parentTransform);
builder.RegisterComponentOnNewGameObject<YourBehaviour>(Lifetime.Scoped, "name")
.UnderTransform(parentTransform);
Expand Down

0 comments on commit 32202fd

Please sign in to comment.