I originally wrote this asset for a private project I’m working on, and I thought others could find a use. Code is fairly commented, I might add more in the future. I will do my best to reply to, and help with any inquiries you guys have, be it feature requests or support.
First of all, Congratz for your wonderful asset. I’m having some problem trying to apply it to a 3d sphere. I can’t get the appropiate option in contextual menú. I’ve created an empty gameobject and applied to it the “Theme Manager” script. After that I created another gameobject and applied to it the “Theme Applier” script. But when I tried to apply the change color to the sphere doesn’t appear the "Material change color " option in the menú.
The Theme Applier uses a UnityEvent. This means that it should be used with anything that exposes Color in its interface. The MeshRenderer used by the 3D Sphere doesn’t have that by itself. But you could easily make a little utility script that exposes Material variables, and add it to the Sphere. For example:
using UnityEngine;
using System.Collections;
public class TestScript : MonoBehaviour {
public Color MaterialColor
{
get
{
return Renderer.sharedMaterial.color;
}
set
{
Renderer.sharedMaterial.color = value;
}
}
Renderer renderer;
public Renderer Renderer
{
get
{
if (renderer == null)
renderer = GetComponent<Renderer>();
return renderer;
}
}
}
I only used sharedColor here, but I’m sure you get the point.
There was a mix up with the versions I submitted to the asset store, but it’s fixed now. Themo should look and work the same in Unity 4.6.x as it does in 5.x.
Hey @KayaOrsan , I found your asset on the asset store and I think that it fits my needs extremely well. I implemented my own color manager but don’t feel that it is the best solution for my needs. I had a couple of questions about the asset if you don’t mind me asking:
Is it possible to change the theme of an object during runtime? One of the main things that I want to do is set up a “Character System” that has a color associated with each character in the game. Would I be able to change the theme of GameObjects (assuming each theme is associated with a character)? Or would I need to change a single themes color to reflect the characters color (a base theme “Player” then change that color)?
Can other scripts still change the color of a sprite without interfering with Themo? Right now some scripts are changing the color of the Sprite Renderer, would that interfere with Themo? Basically what happens if I wanted a sprite to flash red because they got hit but then return back to the theme color.
Of course. Themo allows you fully to change everything during runtime. You can select whether you want changes to apply during an Update loop automatically, or a function call you make, so you have some flexibility there. You could use Themo to set up theme colors for each of your characters, then either change these theme colors, or modify the Hue on the Theme Applier for the individual characters without touching the master theme. All during runtime. You can even animate this. In fact this is exactly what the webdemo does, be sure to check it out. Everything in that scene, including the Logo in the back, is using Themo.
Sure. Themo applies its themes via a component called “Theme Applier.” You could simply enable/disable that component whenever you need. In fact a Theme Applier doesn’t even have to have any objects assigned to it. You could simply use it’s CalculatedColor property. You could also skip the middle man and get the color directly from the Theme Manager if you want to implement your own theme applicator that includes an ability to flash it red. So just off the top of my head there’s four ways you could do this:
a) Disable Theme Applier → Flash Sprite Red → Enable Theme Applier
b) Make a new theme called “Flash Color” and make it red, then just switch the Theme Applier’s current theme back and forth from the original to “Flash Color,” whenever you want to flash.
c) Use the CalculatedColor directly from code.
d) Use the theme color directly from code.
Hope this helps. Please let me know if there’s anything else