Skip to content

Conversation

@Kulltero
Copy link
Contributor

@Kulltero Kulltero commented Oct 5, 2025

Unity's Button Component already supports having the target graphic be of any Graphic type, but the handling of the old json api limited us to only images and only with the limited part of the image api that was explicitly defined

This change allows Using Images with the newer API aswell as RawImages and Text Component,

The old API part is maintained specifically for images but does not make an effort to include new fields or allow applying changes to other types to drive developers to use the dedicated methods for creating their Graphics

NOTE: to make use of this effect your json needs to be ordered appropriately so your target graphic is created before the button otherwise it will attempt to create multiple graphics components on the same GameObject which unity disallows. view the attached test file for an example

Unity's Button Component already supports having the target graphic be of any Graphic type, but the handling of the old json api limited us to only images and only with the limited part of the image api that was explicitly defined

This change allows Using Images with the newer API aswell as RawImages and Text Component,

The old API part is maintained specifically for images but does not make an effort to include new fields or allow applying changes to other types to drive developers to use the dedicated methods for creating their Graphics
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