Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRTK3 Theming for Canvas Objects #11406

Closed
HaiKonofanDesu opened this issue Feb 27, 2023 · 3 comments
Closed

MRTK3 Theming for Canvas Objects #11406

HaiKonofanDesu opened this issue Feb 27, 2023 · 3 comments
Labels
Feature Request Feature request from the community IssueMigrated MRTK3

Comments

@HaiKonofanDesu
Copy link

HaiKonofanDesu commented Feb 27, 2023

This issue has been migrated a new MRTK repository, and the status of this issue will now be tracked at the following location:


Describe the bug

Hey guys, not sure if someone can help me but I currently play around with the experimantal Themeing Option in MRTK3.
Thanks to the Databind Example I got Non Canvas UI to work but not matter what I do I can't get Canvas Elements to change color. I used the 3 Themes from Zappys Playground but I can't use the scripts there as they all depend on so many other scripts and stuff that I don't want to redo all the scripts.

I have the Theme Selector and Theme Provider on an Empty Object that does not get destroyed on Scene change and I have Consumer Helper on my Canvas Object in the current scene. Anyone has an Idea/ and example where it works? I appreciate all the help I can get.

To reproduce

I have the Theme Selector and Theme Provider on an Empty Object that does not get destroyed on Scene change and I have Consumer Helper on my Canvas Object in the current scene.

Expected behavior

Canvas Object changes color

Screenshots

image
image
image

(the small non canvas Button changes color, just not my big Login Canvas)

Your setup (please complete the following information)

  • Unity Version 2021.3.15f1
  • MRTK Version [e.g. v2.0]

Target platform (please complete the following information)

  • HoloLens 2

Additional context

Could only find Non Canvas Examples in this Repo. The only color changing canvas example I found is Zappys Playground. Saldy since I did not use Zappys Playground as the base for my project I can't use the scripts 1:1 thanks to all the other stuff that happens there. Might ReDo my Project in the Future with Zappy as the base for translations and stuff but for now I can't

@Zee2
Copy link
Contributor

Zee2 commented Feb 27, 2023

Hey there, I wanted to give a quick heads up to save you some time hunting.

We were in the process of publishing the revised theming system that is compatible with our canvas UI tooling when the entire MRTK team was eliminated. The existing theming system does not work with Canvas UI.

When the team was eliminated, I created a pull request with our work in progress updated theming infrastructure. You can see it here: #11387

Feel free to copy, reuse, repurpose or repurpose that for however you see fit. Unfortunately due to my current job I am not at liberty to contribute.

Sorry I don't have better news.

@HaiKonofanDesu
Copy link
Author

Hey @Zee2 thanks for the anwers. Still mad at Microsoft that they killed this project literally a month before GA. Still thanks for the detailed answer, guess I will use some time in the future to dig into it.

Good luck at your new? job tho!

@HaiKonofanDesu
Copy link
Author

HaiKonofanDesu commented Feb 27, 2023

Got the Themes of Zappys Playground working in my project. Here are all the Steps I did:
Copy this Folder in my Project: https://github.com/microsoft/ZappysPlayground/tree/8693f527a6a30fd8db0c4c7c7bbce98459331c2f/Assets/MSPlayground/Core/Data

Import com.unity.localization through the package manager

Attach the Theme Selector, Data Source Provider and Data Source Theme Provider to an empty Object (my Setting Object)
Attach the "Data Consumer Maskable Graphic Material" Script to your Themeable Object.
Set "Maskable Graphics To Modify" to the Backplate Canvas Element(s) in your Themeable Object
Set "Data Binding Profile" a new Profile with the "Data Key Path" to "MatsCanvas.InnerPlateMaterial"

With that my object got the proper Material. Right now I need to manually do these last steps for all UI Elements but hey as long as it works I'm happy. I'm still open to improvements/ other strategies to make it work.

Big thanks to Edd Smith from the Slack Community for the idea of using the Zappys Playground Data Folder

@AMollis AMollis added Feature Branch Issue found in, or PR destined for a feature branch. Feature Request Feature request from the community and removed Feature Branch Issue found in, or PR destined for a feature branch. Bug labels Mar 3, 2023
@AMollis AMollis changed the title MRTK3 Themeing not working with Canvas Objects MRTK3 Theming for Canvas Objects Mar 3, 2023
@AMollis AMollis added this to the MRTK v3.x future milestone Mar 7, 2023
@IssueSyncBot IssueSyncBot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feature request from the community IssueMigrated MRTK3
Projects
None yet
Development

No branches or pull requests

5 participants