A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in '2019.3 Beta' started by pointcache, Jul 16, 2019.
Can you post a screenshot?
It ends up looking pretty much exactly the same as the last editor screenshot I posted in this thread, so I figured it wasn't worth the effort to take one
EDIT: The main difference is that the package manager is more readable (but still not entirely correct):
Using a ripped dark.uss:
Using the script:
Ok. I wonder why the toolbar buttons don't change, because other stuff seems to look good.
It almost feels like some stuff is still hard-coded or not properly moved over to UIElements yet, because I'm pretty sure all of the stylesheets are being properly modified.
I see all of this after just spending a few hours working through the ripped dark.uss and my file
At about the same point now as the screenshots above except, that the Package Manager is the same as the top screenshot. Profiler Still needs work as well as some icons. @TheZombieKiller Did the script also get all the icons/image file for the dark theme or just some of them?
Tested your script and it doesn't seem to change some of the icons (Same ones I'm missing) to the dark theme version. Also, My Package manager gets a style from yours, almost fully switched to the dark version. I think Your Script mixed the generated styling with mine.
I switched to a project that has the version I am working on without the theme inverter/converter and the Package Manager still looks the same as the project I used it in..
It's weird... it's almost like some of the icons simply aren't specified via stylesheets yet.
Yeah, the dark theme patch will persist until the editor is restarted.
Which version are ya'll using? I imagine that could make a difference, yes?
I came across some stuff on github from package caches, just wanted to share it incase it ends up being helpful at all.
@TheZombieKiller It seems some of the fonts have a black color with the script, is there a way to exclude the font colours from inverting?
@Lars-Steenhoff I think it's less that the text is being inverted, and more that it isn't being affected at all.
Is it possible to take the inverted style and export it as a static style so it can be edited?
Yeah, I posted some code earlier in the thread to dump stylesheets, although I think it needs some minor changes to work with the latest version of Unity.
I tried to run it, but keep getting the following:
[Exception] NullReferenceException: Object reference not set to an instance of an object
355: var sb = new StringBuilder();
-->356: if (sheet.complexSelectors != null)
358: for (var complexSelectorIndex = 0; complexSelectorIndex < sheet.complexSelectors.Length; ++complexSelectorIndex)
372: public static void WriteStyleSheet(StyleSheet sheet, string path, UssExportOptions options = null)
-->374: File.WriteAllText(path, ToUssString(sheet, options));
55: if (!string.IsNullOrWhiteSpace(folder))
-->57: StyleSheetToUss.WriteStyleSheet(sheet, write);
There's a solution for that earlier in this thread as well, it involves adding the StyleSheetToUss.cs file into your project and making a minor change to it.
Yes, I have done that. I made sure to go over all the steps you had twice. I also did the change for having the check for the null string, I believe it was.
I suppose it might be the placement of that file, does folder structure matter? I placed the file in the same folder as the export file and the assembly definition.
Hmm, maybe it's been broken yet again. What version of Unity are you using?
The newest beta as of this moment. I believe it is 2019.3.0b3.
Just tried it in 2020.1.0a3 and it worked fine. I put everything in a folder called Assembly-CSharp-Editor-testable like so:
StyleSheetExporter.cs is the script from https://forum.unity.com/threads/uni...ui-look-like-garbage-now.709037/#post-4751006 with the fixes mentioned earlier in this thread, to clarify.
The modifications were:
StyleSheetExporter.cs : line 55
Then in StyleSheetToUss.cs change the namespace to : ThemeExporter.StyleSheets
Then change the using statement in StyleSheetExporter.cs to reflect this change.
As well as StyleSheetToUss.cs : line 186
Does anything need to be set within the Assembly definition settings? As seen here I have the files placed just as you mentioned.
I do use Linux, not sure if perhaps that might have some impact on this? I would not think that it should.
Hmm, I wonder. What if you change
The error seems to be related to a stylesheet being null.
Well, it didn't error, but then it seems it didn't end up doing anything at all at that point?
Ok, so I was able to generate them. I tried to invert it using your other script first and then generate, which it looks like it did judging by several of the colors set in the file. Though, either I must be doing something wrong with the actual StyleSheets, or they don't seem to actually do anything. So far the *only* thing I have been able to use to make an actual noticable permanent change when it comes to style sheets is downloading the little tiny one-liner (3 lines) from the Unity dev who linked to one that had .dockheader or something along those lines in it, which did in fact change the color of the dock. It was in StyleSheets/Extensions/ ** light.uss/dark.uss/common.uss.
I had the generated/exported stylesheets from your script located in Assets/Editor/StyleSheets/**. I tried to make a few manual changes to them just to see if they would produce and noticable changes but I have yet to see any. Is this to be expected? I noticed several of you fellas had much more changes outside of just running the inversion script. I have yet to find a copy of a StyleSheet anywhere that I could try and use.
This is awesome guys! Any chance this will all be packaged together to help us make our own ui themes?
It is, but it also sucks. Everything is there and available to fully theme the entire editor however you wish, but I just don't have all of the pieces to this puzzle.
You may need to restart the editor, or run some code that calls EditorUtility.RequestScriptReload/InternalEditorUtility.RequestScriptLoad followed by InternalEditorUtility.RepaintAllViews. I recall having a bit of trouble trying to get the changes to apply at first as well.
I thought that might be the case as most times that I use the invert colors script I have to hit play and then stop, but none of that seems to be working. Just to see, I put the Extensions folder back in with the common, light, and dark.uss files in it and the color instantly changed for that one dockheader that was in there, I took it back out, color went away, still nothing from the StyleSheet.
I have the StyleSheets folder within Editor, Editor/StyleSheets/Generated/ => which has 4 files in it for DefaultCommonLight/Dark, then same for Toolbar, then on up in StyleSheets is another set of DefaultCommonLight/Dark.uss. Does that sound like it is supposed to be?
I've managed to fix some of the issues and created something between dark and light. Repo soon.
Nice! how did you get the icons to edit them as well as edit the package manager font color?
Ooo very nice. It would be so cool to get a tool that lets us make our own themes, like blender does. I know there used to be a tool like that but it no longer works
Got everything from Resources.FindObjectsOfTypeAll<T>();
- styleSheet.name == "PreviewWindow" has to be ignored otherwise preview is inverted
- all text rendered correctly
- added more icons, right now ~2200 of them
But now I'm stuck... As u can see above folder icons in Project window are wrong although I made an icon and even set all GUI.skins to use it ;/
Fun fact: it almost works in 2019.2 too
Looking at C# inspector, it's using AssetDatabase.GetCachedIcon(path) that's implemented in C++. No idea how it's working.
Tried using https://github.com/Unity-Technologi...ter/Editor/Mono/GenerateIconsWithMipLevels.cs it did generated icons but they are not used by Unity
UnityRed anyone ?
Found a way! Even toggle check marks are dark.
3 dots weren't working but now they are
This is great! Did you have a repo setup or anything, or are you just taunting us with this amazingness, lol?
Btw, is it possible to strip 19.2 theme and insert it in 19.3+ Hmm...
I'm mainly showing that it's possible and not that hard. ~500 lines of code does everything. I'd open a repo but I'm worried about Unity patching the ways I did the conversion. Especially since for ex. my hacky icon swap crashes unity 2019.2 lol. I'd like to know if there is any proper/public way to replace AssetDatabase.GetCachedIcon(path) icons. @jonathans42
Just tried and it worked! Presenting you Unity 2019.3 light skin inverted with 2019.2 light inverted icons. (+ font from preferences)
Whatever happens Ill open repo when .3 is out of beta
Super exciting and excellent work!
I don't think any of this stuff is on accident/secret. They purposely exposed everything to be edited and expected people to dig around through it. I don't think there is any reason to have to hide any of it. I mean, a Unity member was the first one to post a small example on how to change color in the editor that I saw. I think they are just quietly sitting back to see who busts out the hotness first, lol.
It would be nice if perhaps someone could confirm that it's ok to do this so that everyone doesn't have to feel like they are doing something wrong and people can start sharing the awesomeness guilt free.
Hmm some news about dark inc in 2020:
It is coming boys
Hey everyone, any new updates on this with the 2019.3 final being released?
What I've heard from the rumors is the possibility of it coming in 2020 versions at some point
I totally agree, it would be nice if someone could confirm that it's fine to do all this.
Excited to hopefully see an official dark mode come to Unity Personal 2020!
So I got the confirmation from the legal department that creating modified style sheets and sharing them is not breaking the EULA.
That being said, the ability to do so is a side effect of the the improvements we made to our UI systems, to make it easier for everyone to create customized tools. Sharing them is not something we want to encourage, for the simple fact that we can't guarantee that what you distribute won't break in the future, as it was not meant to be used this way.
Creating and sharing Editor themes is something I would really like to have in the product though, with the proper tools and delivery mechanisms.
You guys are making some really cool looking themes by the way
I can imagine that the way I found can be very easily broken on purpose in future updates
I've been using it for some time:
We're not planning to add constraining measures on purpose, we'd rather enable better tooling for this, we're just not ready yet. The work that has been done for the new Editor themes in 2019.3 will certainly evolve and we're not certain how yet. So it might break, but it won't be to counter whatever you're doing.
A note on Dark Theme, as it seems to be the main driver for doing heavy customization. If it was only for me, it would be free. I've been pushing really hard for this to happen during the last year and although we're getting very close to an agreement, we're still not there yet. And frankly, if some people are using that method so they can spend more quality time within Unity, then so be it.
The hero we need, but don't deserve.
Thank you, very good news.
Well rip, it stopped working, looks like editor icons are no longer loaded from the folder
Source, maybe someone finds why it doesn't work:
Changing icons still works:
var texture2 = (Texture2D)EditorGUIUtility.LoadRequired("Icons/" + texture.name + ".png");
texture.UpdateExternalTexture( texture2.GetNativeTexturePtr() );
Don't worry. I have my own solution working flawlessly with Unity 2019.3.11 and even with the Unity 2020.1 beta versions. I will be sharing the repository later today. In the meantime, take a sneak peek...