Comments (4)
@codyrchildress You can do that using C# API of the package.
// Link ThemeDatabase,
// path to the file in your project: `/Assets/Resources/Unity-Theme Database.asset`
[SerializedField] ThemeDatabase themeDatabase;
// change the current theme to a new theme from existed themes list
themeDatabase.CurrentThemeIndex = 1;
from unity-theme.
@codyrchildress hi. Thank you! Yes, it works in Edit Time and in Play Time (runtime).
You can create multiple different UI styles in the settings of the game. Or use for Day/Night cycles. Any approach works. All the Binders are subscribed to the color change event.
from unity-theme.
Thank you for the reply. How would I raise this color change event, and how do I specify the theme I want to switch to?
from unity-theme.
Is it possible to get the list of themes from another script and set it instead of by name or index?
Example. I create a ThemeManager script to call it by name but would be awesome if I could get the list of available themes and set it within in my script. this way each scene can have its own theme set.
I feel like it may be doable but you cannot access 'themes' because it is private.
from unity-theme.
Related Issues (10)
- Themes HOT 2
- Color still changes while component is disbaled HOT 1
- The type or namespace BaseColorBinder could not be found HOT 1
- Cannot chose color "No GUI Implemented" since 2.0.0 HOT 3
- Unity-Theme database was not found HOT 2
- Change binder's color in runtime HOT 2
- Changes in Theme Window not saving HOT 1
- The type or namespace name 'DropdownField' could not be found HOT 4
- Current theme in Editor view does not update when changed by script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unity-theme.