Giter VIP home page Giter VIP logo

Comments (4)

IvanMurzak avatar IvanMurzak commented on May 30, 2024 1

@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.

IvanMurzak avatar IvanMurzak commented on May 30, 2024

@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.

codyrchildress avatar codyrchildress commented on May 30, 2024

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.

iiidefektiii avatar iiidefektiii commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.