Skip to content

Conversation

@migus88
Copy link
Contributor

@migus88 migus88 commented Aug 4, 2025

When working with source generators, if you try to do something like this on a class that inherits from Component, you will receive a NotSupportedException when trying to inject it.

builder.Register<SomeMonoBehaviour>(Lifetime.Singleton);

When working with reflection injection, the creation of a component that way is allowed.

This PR aims to align the implementations and to prevent a reflection created instances of Components.

⚠️ This might be a "breaking change" for some who used this approach in their project intentionally or not (in our case it was unintentional and it was causing havoc).

@vercel
Copy link

vercel bot commented Aug 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vcontainer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 6:30am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant