Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Workflow Case Study - Show us your pain!

Discussion in 'Editor & General Support' started by willgoldstone, Mar 1, 2019.

  1. DrViJ


    Feb 9, 2013
    Hi to all! my "pain" was some of SceneView behaviors.

    One of them was the near clipping plane distance minimum clamp to 0.01 value. And thanks that it was changed to 1e-5f in Unity 2020! That is great!

    But some other features are not changing for years and are difficult to use for me, especially when scene objects are exceedingly small. (less than 0.1 unit)

    1) the zoom in/out to tiny objects. The zoom usually flies through object or point of my interest. pressing F does not help in this situation, cause scroll sensitivity is extremely high.
    2) the object clipping in orthographic view cause of ortho camera position
    3) the rotation around objects. it is difficult to navigate in scene

    But the most thing I love in Unity is that I can override these behaviors with Editor's API, which is very flexible

    @willgoldstone Thank you for this forum thread. I want to show you some of ideas, that I like in different 3d editor applications. Maybe you like some of them and include something like this in future releases

    That is my solution implementation to solve my problems:

    1) The rotation around object point under the cursor:
    We could use ALT to rotate around point (if it exists) or around current SceneView plane (if it does not). We can rotate as usual (around pivot point of SceneView) if ALT is not pressed

    2) We could use ALT to zoom to point on object, but without fly through this point (no negative sceneview size). it can help to move very close up to objects

    3) It would be great to have the ability to change the distance from camera in orthographic view to prevent objects culling
    Last edited: Oct 18, 2020
  2. awesomedata


    Oct 8, 2014
    Hehe -- This must definitely be a sore spot -- Someone else posted about this a few posts up! :D

    As much as it sucks -- I think @Unity's position on this is that we make our own "Custom Inspectors/Editors" for pretty much all of these needs.
    And yet, that process is still a freaking PAIN.
    UXML, CSS, etc. didn't really help with this process at all -- and actually made it even more convoluted and programmer-centric than it was before (despite the UI performance increase).
    A visual tool to make these kinds of things was promised, but wasn't really delivered on. :(

    Ultimately, a search-based tool is a decent enough solution -- but for discoverability purposes, it sucks.
    And like you said, you'd want to be able to change what shows up in it -- as would everyone else -- and as far as I know, the Spotlight-like tool (I forget the name of it) is a good substitute for something like Peek, but it can be a pain when too many similarly-named things appear together (i.e. tons of sprites named "NPC_male_armor_torso_breastplate_...", "NPC_male_clothing_shirt_shirt01", etc.)

    This is when a better (set of) Asset Library editor windows would come in handy.
    Label different kinds of assets as a hierarchy based on scope (i.e. environmental > rocks, UI > main_menu, characters > enemies, or even misc > dogs/cats) -- which would (ideally) be able to be easily applied to assets and gameobjects / prefabs alike (i.e. similar to the "Tags" concept I keep belaboring in the Visual Scripting thread).
    Being able to access the organizational scope of assets'/prefabs' Traits/Attributes/"Tags" in-game at runtime could be an integral part of programming in Unity too, leading to many powerful scenarios besides editor-based organization -- i.e. for organizing programming logic as much as for enabling easily-moddable assets.)
    NotaNaN likes this.
  3. awesomedata


    Oct 8, 2014
    This. 1000 times this.

    I actually created a plugin called Snapcam to address some of the issues of the Scene Camera. However, I got a bit overwhelmed at the massive amounts of "locking-away" functionality that Unity does to the internal Scene Camera Controller API -- i.e. You cannot simply override some of the stuff you don't like and re-implement it yourself -- You've essentially got to rewrite the whole Scene View Camera Controller yourself -- and HOPE Unity doesn't silently break your changes going forward.

    Honestly, I work in multiple scales in the same scenes A LOT -- and you illustrated all my issues with Unity's rotation and zoom 100%.

    I actually quit making games in Unity for a while due to this issue -- I focused on art tools instead.
    It drives me NUTS to work with Unity's terrible camera system while designing games. :(
    Ruslank100, NotaNaN and DrViJ like this.
  4. Kearan-Petersen


    Apr 16, 2018
    I've tried my hand at getting this type of feature working. There are some hacky things here and there, so if the Unity Team gets time to implement this, it will probably be more solid than what I was able to manage.

    Took just about 6-8 hours I think, so it's not that tricky. I think if performance for such a feature is a concern, then there can always be an opt-out option. I'd prefer it to be opt-out, as this is of course a very useful feature to have out of the box.
    oxysofts and DrViJ like this.
  5. Neonage


    May 22, 2020
    My biggest pain as Editor Extensions developer is lack of references to engine internals.
    Ex. CollabProxy package has hardcoded access by assembly name somewhere internally, so CollabToolbarButton can inherit from SubToolbar and add this to Toolbar.
    For us to do the same we have to use fancy Reflections that can break anytime, because source code had one letter changed and you don't know which one.

    Why advanced users cannot have same level of access with some hidden button? It would make development of advanced tools or UX extensions so much easier :(

    Take my Hierarchy extension for example, I have to do this:
    Reflect HierarchyWindow > SceneHierarchy > TreeView > FindItem > compile into fast expression.
    And all this is just to directly set the icon of TreeViewItem, so hacky for so simple!!


    The funniest of all is that I got used to it... :\
  6. awesomedata


    Oct 8, 2014
    I concur -- and I would say "get used to it" -- but...

    You have "gotten used to it" -- And it still sucks enough for you to post about it. lol.

    This is the story of every Unity user's life, man... :(

    This is exactly why I b*tch and moan about every 'little' problem that would eventually impact my workflow (followed by constructive ways to solve said problem for everyone) -- the more of those kinds of posts out there, the more likely someone at @Unity will eventually take notice...

    Maybe. :(

    ...If it didn't leave its "feedback" at the mercy of a few college grads who just got out of marketing school, and instead put it in the hands of someone who knows (details) about the internals (who is interested in improving Unity as a whole). Perhaps this didn't go well in the past or something, and maybe they have their reasons -- but I never felt like anyone at Unity (who received my feedback) ever has enough authority (or know-how) to take it to the next step -- and therefore be able to improve my workflow.

    @willgoldstone -- take a look at how SideFX and BlenderFoundation are doing things.
    Maybe you guys can come up with a better version of those feedback systems that work for you.

    This thread was a great start -- but it kind of seems like nobody's listening anymore.
  7. Deozaan


    Oct 27, 2010
    It seems like Unity have mastered the art of creating a "frustration quarantine" thread saying, "We're finally listening to you! Tell us everything you want fixed and we'll do it!" and then letting us vent all our frustrations into one single, contained, focused space that nobody with any authority to change anything is actually paying attention to.

    Then once people catch on that nobody's really listening and the frustration starts making its way out of quarantine and into other threads, Unity creates a new quarantine thread in which the process starts itself over again.
  8. Rowlan


    Aug 4, 2016
    Doubleclicking a window title bar usually maximizes a window. It doesn't work e. g. for the Profiler. Would be nice if this could work on all windows.
  9. oxysofts


    Dec 17, 2015
    I do start to wonder whether are still closely monitoring the comments here, or if we are wasting our time since page 2-3. The Unity Editor tooling needs more than just surface fixes, so far I am not impressed with the workflow revisions we were promised in 2020. Great progress in other areas and I like the focus on performances, but still nothing on the horizon about an editor rework..
    DrViJ, Neonage, Havokki and 2 others like this.
  10. Innovine


    Aug 6, 2017
    It takes me up to 114 seconds to scroll down the list of scripts when I want to change the script execution order. And I have to scroll through that list from the start every time I add another script to the execution order window.
    KAJed likes this.
  11. Baste


    Jan 24, 2013
    Don't use script execution order.
    Don't use script execution order.
    Don't use script execution order.

    I mean, yes the window sucks and should be fixed, but when you extensively use the script execution order to make things work, you have to go to a window in the editor and scroll it to understand your code. It's really bad, and it gets messy fast.

    Initialize yourself in Awake, grab dependencies in Start, and if that's not enough you have too tight dependencies.
    ModLunar and NotaNaN like this.
  12. NotaNaN


    Dec 14, 2018
    Unfortunately, Unity never tells you that Script Execution Order should only ever be used for packages that wish to have their contents run at a specific time relative to other packages.

    @Innovine, the best thing that you can do, sadly, is make a custom Update Manager so you can structure your update order yourself.
    I'm sure that is information you wished you knew before you had a hundred scripts to edit, but if you want to maintain your sanity in the long run, it's what you need to do. :(
    Last edited: Oct 29, 2020
  13. Innovine


    Aug 6, 2017
    I have a floating origin system, an orbital mechanics system, and regular rigidbody physics, all of which manipulate the object transform. It's important that the scripts execute in a deterministic order, but thanks for your input.
    KAJed likes this.
  14. sand_lantern


    Sep 15, 2017
    Then you probably shouldn't be simply running update for all of them, instead have a single manager object that updates them individually in the order they need. In general, be careful about using Update too liberally anyways because it gets expensive from what I understand. It also means you have to rely on script execution order which is messy.
  15. Innovine


    Aug 6, 2017
    Some of the code is 3pp assets so I'm not gonna go re-writing them just because Unity can't do a damn scroll bar.
    KAJed, sand_lantern and Baste like this.
  16. Bordeaux_Fox


    Nov 14, 2018
    If they cannot do a scrollbar, they cannot do realtime point light shadows for URP. :p
  17. Innovine


    Aug 6, 2017
    A list of what they can't do would be quite long..
  18. giantkilleroverunity3d


    Feb 28, 2014
    Well aint this a list of dried boogers.
    My issue is in 2020.1.9f1.
    I have over 100 assets from large houses to indie devs.
    Currently I have a scenario where I need an asset fixed, brought up to speed, updated, mogrified into oblivion or what ever label you want.
    I have gotten very terse with the smaller indies because they are slow to respond or non existent. I get it. The Unity asset demands are tough. I know their plight. This isnt their day job and the crash support is probably huge when numerous projects break across the globe who are production houses and they depend on a constant reliable workflow. But with a broken asset you just cant get a reliable workflow. Caveat Emptor.
    As developers, we know the routine. You get into a work zone because the workflow works well. Its addicting and satisfying to see your creation come to life. But that party is off the cliff when assets break due to some internal change Unity makes or the asset devs drop off the planet. I have two dead assets at the moment that I had high hopes for.
    My workflow is busted and I have to switch tracks to keep things moving. Its just me. I am retired. I can wait this out. But life's a bitch when you get your chain yanked midstream. It is like the Unity environment has gotten too large for small devs to play in whether asset devs or Unity devs. Small devs pay good money for assets where their budget might be tight or they are on allowance from parents. But I am glad I am not a large production effort where time, budgets, & investors are breathing fire every day because of their lust for greed. Human collateral is the constant fodder for their day.
    Maybe I will get an answer someday on my issues and maybe I wont. The assets are touted as the 'Scene event you gotta have' and the purchaser says 'Yeah that would really enhance my product!' So they buy it, install it, make it work and go batshit, wonderously emphatic over their scene. Rightly so. Then the upgrade hits and the asset fails. Now that scene event is not there and the game play dies because the workflow dies. 'Nuff sed.
    NotaNaN likes this.
  19. davidnibi


    Dec 19, 2012
    Moving objects to a different folder in Hierarchy opens the folder - it would be nice to have an option to prevent this, I'm just moving it, I don't want to see the contents really, especially if the list is long.
  20. davvjs


    Nov 13, 2016
    In the bug reporter its not clear how to add all your sourcecode.
    The "add folder" button doesn not say if it includes all files inside.
    No files except the "folder" are appearing in the "attached files" after adding a folder.

    There's no "one button" press for sending feedback.
    I got redirected to an informative forum post but without any call to action on where to go next. It just says post it to the "forum". Where in the forum? Also I have to register? Also I have to read a long forum post explaining "why" I should post it in the forum? I just want to find where I should post my feedback!

    Requiring that much effort from people who might already be annoyed and about to leave the product can result in you losing out on the most valuable feedback. ;)
    ModLunar, FernandoMK and sand_lantern like this.
  21. MagdielM


    May 27, 2020
    From what I've been able to piece together from other topics on the forum, it seems that several of the teams have hunkered down to work on engine internals and modernize Unity's back end. Unfortunately, this means that relatively first-world problems like editor workflow issues get pushed way back because why would you make sweeping changes to a front-end system when internal API changes are bound to break it soon after? And honestly (provided I'm right about this), I can't blame them. If they tried to work on both ends of the spectrum at the same time, Unity 2021 would never leave alpha. They'd break records for bug reports per second.

    I just wish they'd say it outright, but they won't because "we're too busy fixing our own stuff to deal with your problems" is disastrous marketing speak.
  22. sand_lantern


    Sep 15, 2017
    For what it's worth, they did just show off some major changes to toolbars/floating menus for 2021.1

    For the most part, you're probably correct and a lot of things we could use we aren't going to get, but at least it's something.
    NotaNaN likes this.
  23. kurifodo


    Jan 17, 2019
    I recently posted on the forum about Asset Bundle workflow pain. Please see post I'd love it if Asset Bundles built when the Play button in the editor was clicked. In addition, when building the project, Asset Bundles do not output to the build directory. :( Why aren't Asset Bundles part of Unity's build (File -> Build Settings -> Build button)? They are required assets for running the game.
  24. Marc-Saubion


    Jul 6, 2011
    Isn't it their reputation already?
  25. Lukas_Andriejunas


    Unity Technologies

    Aug 19, 2016
    Hi davvjs,

    To clarify, Bug Reporter does add all the files and folders in the selected folder when using an “Add Folder” button.

    The improvements regarding Feedback Redirection to Forum will be addressed in the next iteration of Unity Bug Reporter. Users will be able to access the forum by pressing a button directly from the Bug Reporter. In an opened browser window, users will be able to select an area and create a new forum post there.
    ModLunar and davvjs like this.
  26. useraccount1


    Mar 31, 2018
    One minor issue I have found lately. I was trying to open dots based project from github, downloaded right version of unity, but my firewall blocked access so I couldn't download packages.

    Well, this is the error that has appeared:

    Note: This picture is 413x1080 pixels
    Note: I have 1080p monitor.

    So the error is taller than my screen. Closing this window wasn't hard at all, but If fixing this issue is trivial, then someone should do that.
  27. FiveXGames


    Apr 27, 2016
    I don't know if it's already mentioned but

    I will recommend a really simply thing that drives me crazy when working with textures channels.

    Please put a "show in grayscale" check for the channels texture preview, I don't want to see the blue color in my metallic map, or the green color in an ambient occlusion map.

    A lot of other tools has this easy of use checkbox of not showing color in channel previews (Who wants an arbitrary color in a grayscale map?), and probably aside the UX considerations is not hard to implement.

    Not to mention when you are working with masks or you need to compare maps in different channels is huge pain to "mentally desaturate them"

    Attached Files:

  28. Whatever560


    Jan 5, 2016
    Don't now if similar was posted but. Create and Duplicate objects in place instead of the end of the hierarchy list ... create child as first sibling instead of last. c'mon. I replaced the original shortcut and its SO MUCH BETTER !

    Code (CSharp):
    1.     public class EditorHierarchyUtils
    2.     {
    3.         [MenuItem("GameObject/Duplicate as sibling"), Shortcut("GameObject/Duplicate as sibling")]
    4.         private static void DuplicateInPlaceWithBetterName()
    5.         {
    6.             var objs = Selection.gameObjects;
    7.             if(objs.Length == 0) return;
    8.             var siblingOrders = objs.OrderBy(o => o.transform.GetSiblingIndex()).ToArray();
    9.             var lastIndex = siblingOrders.Last().transform.GetSiblingIndex();
    10.             var instances = new List<Object>();
    11.             foreach (var gameObject in siblingOrders)
    12.             {
    13.                 lastIndex++;
    14.                 var parent = gameObject.transform.parent;
    15.                 var instance = Object.Instantiate(gameObject, parent);
    16.        =;
    17.                 instance.transform.SetSiblingIndex(lastIndex);
    18.                 Undo.RegisterCreatedObjectUndo(instance,;
    19.                 instances.Add(instance);
    20.             }
    21.             Selection.objects = instances.ToArray();
    22.         }
    23.         [MenuItem("GameObject/Create New Sibling"), Shortcut("GameObject/Create New Sibling")]
    24.         private static void CreateNewSibling()
    25.         {
    26.             var objs = Selection.gameObjects;
    27.             if(objs.Length == 0) return;
    28.             var gameObject = objs.First();
    29.             var parent = gameObject.transform.parent;
    30.             var newGO = new GameObject("GameObject");
    31.             newGO.transform.SetParent(parent, worldPositionStays: false);
    32.             newGO.transform.SetSiblingIndex(gameObject.transform.GetSiblingIndex() + 1);
    33.             Undo.RegisterCreatedObjectUndo(newGO,;
    34.             Selection.activeObject = newGO;
    35.         }
    37.         [MenuItem("GameObject/Create New First Child"), Shortcut("GameObject/Create New First Child")]
    38.         private static void CreateNewChild()
    39.         {
    40.             var objs = Selection.gameObjects;
    41.             if(objs.Length == 0) return;
    42.             var gameObject = objs.First();
    43.             var parent = gameObject.transform;
    44.             var newGO = new GameObject("GameObject");
    45.             newGO.transform.SetParent(parent, worldPositionStays: false);
    46.             newGO.transform.SetSiblingIndex(0);
    47.             Undo.RegisterCreatedObjectUndo(newGO,;
    48.             Selection.activeObject = newGO;
    49.         }
    50.     }
    ryanlin138, Neonage and NotaNaN like this.
  29. Whatever560


    Jan 5, 2016
    I wanted this for Cinemachine cameras. So hard to cycle through them efficiently. I'll probably end up to create my own editor window, though it's a pain ...
  30. Neonage


    May 22, 2020
    11 months old reply from Cinemachine 3.0 video: "We are working heavy on the Cinemachine UX, expect to see some big improvements there next year". I guess we'll hear some updates pretty soon.

    This. It is the most frustrating thing when working with big hierarchies. I was thinking on fixing this, as well as adding a "Cut" functionality. Would you mind if I bring this into my hierarchy extension? :D
    Whatever560 likes this.
  31. Whatever560


    Jan 5, 2016
    It might need some tweking because it overlaps with project duplicate. It also duplicates prefab in hierarchy as unpacked clone instead of instances.
  32. useraccount1


    Mar 31, 2018
    I still want to believe the staff is reading this thread.

    Today I got reminded about the existence of GiCache the hard way. It took all of my free space on the system partition (over 60 Gb which is more than the limit in preferences allows for). It took so much I had a problem doing anything on my computer because it got so slow.

    One small QoL change I would like to ask for. Could we see the most basic information about the total size of GiCache in the Lightning (settings) window? And maybe add one button which would direct us to the proper preference settings?
    Also, since I know the editor can mindlessly go beyond the limit. Is there any possibility to detect If the scene is so big that the limit will be breached? Would be nice to have that.
    Maybe even some less important checks, whether the user is using HDD, or If the user does have GICache on the same partition as OS/ editor? I feel like the unity shouldn't recommend this in case of big scenes.
    NotaNaN likes this.
  33. Master_Zen


    Apr 2, 2017
    I'm not sure, if this feature was already requested. Navigating trough the projects assets would get more pleasant, when just like in normal file explorers, the back and forward button (found on some keyboards or on the side of some mouses) could be used to go back to previosly visited folders.
    Just like you can skip through previosly visited websites in the browser.
    Lars-Steenhoff likes this.
  34. Lars-Steenhoff


    Aug 7, 2007
    Master_Zen likes this.
  35. DearUnityPleaseAddSerializableDictionaries


    Sep 12, 2014
    Editor pain:
    * Dictionary in inspector natively.
    * Able to reorder List/array and dictionary in inspector.

    There are thousands of stars in Reorderable List or Dictionary in inspector. Since 2013 I've been waiting for these, but they have not come. One would have thought these would be the default features in Unity from the first version.
    ModLunar and sand_lantern like this.
  36. Bordeaux_Fox


    Nov 14, 2018
    You can reorder arrays by dragging them in the editor in 2020.2.0f1.
  37. DearUnityPleaseAddSerializableDictionaries


    Sep 12, 2014
    Finally! Can't wait for 2020.2.0f1 to be LTS.

    Now for dictionaries.
    ModLunar likes this.
  38. RocketBoyStudioGames


    Mar 20, 2015
    Half our lives... Just wanting things to go faster. I need a supercomputer.

    Ruslank100 likes this.
  39. XRA


    Aug 26, 2010
    there is a horrible Editor UI bug that has persisted through the 2018.x, 2019.x and now 2020.x releases, when clicking any of the small circle target icons to select an asset, clicking anywhere within the asset popup window makes it disappear without selecting an asset. It is also not possible to select the window title or scroll bar as any click makes the asset popup window disappear.

    It happens multiple times in a row and takes ALT Tabbing out of Unity and clicking on other UI within the Editor to fix it (before it occurs again randomly)

    I've gotten the issue on multiple computers and am pretty sure it has been reported in the past, still not fixed.
    Ruslank100 likes this.
  40. FiveXGames


    Apr 27, 2016
    Yes is a well known bug ... e.g I address it here:

    Short version: I believe I found a way to mitigate it, in preferences in General there is an option called "Interaction Mode" change to "Monitor Refresh Rate" instead of "Default" (or maybe the other modes helps)
  41. davvjs


    Nov 13, 2016
    I believe most workflow issues for programmers stems from the fact that the editor runs code in the same process (no other development environment does this).
    - Editor crashes when game crashes
    - Editor freezes when you switch from your code editor after having made changes to the code.
    - The fact that domain reloading and resetting state is a thing and takes time. In other programming environments you kill your program and all memory is cleared instantly.

    Solving these issues would require expensive major rewrite of the editor. I instead propose making a lightweight runner for programmers, solving the programmer related workflow issues once and for all.
    Ruslank100 and FernandoMK like this.
  42. omsrobert


    Oct 21, 2020
    I'm an experienced developer but new to Unity and 3D/XR. Here is my feedback:

    - Let us save any project as a template. This way, we can configure it as we see fit and use it for multiple projects. There should be a defined folder path for these custom templates.

    - There should be more ready made templates. For example: With XR, have a XR Rig and hand controllers all set up with a simple cube or ball in the center.

    - Since you color coded the X, Y, Z axes in the editor, you need to repeat these in the inspector for X, Y and Z. It may seem minor or obvious but it's important for both experts (less need to think) and beginners.

    - Measurement game objects. We should be to create a ruler object(s) that we can drop into the scene to aid in debugging.
  43. calc1fer


    Oct 5, 2019
    Implemented menu to add customized script by reflection.

    Code (csharp):
    2. using System;
    3. using System.IO;
    4. using System.Linq;
    5. using System.Reflection;
    6. using UnityEngine;
    7. using Object = UnityEngine.Object;
    9. namespace CustomScriptCreator
    10. {
    11.    internal class RProjectWindowUtil
    12.    {
    13. #if UNITY_2020_2_OR_NEWER
    14.       private const string assemblyName =
    15.          "UnityEditor.CoreModule, Version=, Culture=neutral, PublicKeyToken=null";
    16. #else
    17.    private const string assemblyName =
    18.          "UnityEditor, Version=, Culture=neutral, PublicKeyToken=null";
    19. #endif
    22.       #region WRAPPER
    24.       public static void ShowCreatedAsset(Object o)
    25.       {
    26.          UnityEditor.ProjectWindowUtil.ShowCreatedAsset(o);
    27.       }
    29.       public static void CreateScriptAssetFromTemplateFile(string templatePath,
    30.          string defaultNewFileName)
    31.       {
    32. #if UNITY_2018_4
    33.          CreateScriptAsset(templatePath, defaultNewFileName);
    34. #else
    35.          UnityEditor.ProjectWindowUtil.CreateScriptAssetFromTemplateFile(templatePath, defaultNewFileName);
    36. #endif
    37.       }
    39.       public static void StartNameEditingIfProjectWindowExists(
    40.          int instanceID,
    41.          UnityEditor.ProjectWindowCallback.EndNameEditAction endAction,
    42.          string pathName,
    43.          Texture2D icon,
    44.          string resourceFile)
    45.       {
    46.          UnityEditor.ProjectWindowUtil.StartNameEditingIfProjectWindowExists(
    47.             instanceID,
    48.             endAction,
    49.             pathName,
    50.             icon,
    51.             resourceFile);
    52.       }
    54.       #endregion
    56.       #region REFLECTION
    58.       internal static UnityEngine.Object CreateScriptAssetFromTemplate(
    59.          string pathName,
    60.          string resourceContent)
    61.       {
    62.          string str1 = resourceContent.Replace("#NOTRIM#", "");
    63.          string withoutExtension = Path.GetFileNameWithoutExtension(pathName);
    64.          string str2 = str1.Replace("#NAME#", withoutExtension);
    65.          string str3 = withoutExtension.Replace(" ", "");
    66.          string str4 = str2.Replace("#SCRIPTNAME#", str3);
    67.          string templateContent;
    68.          if (char.IsUpper(str3, 0))
    69.          {
    70.             string newValue = char.ToLower(str3[0]).ToString() + str3.Substring(1);
    71.             templateContent = str4.Replace("#SCRIPTNAME_LOWER#", newValue);
    72.          }
    73.          else
    74.          {
    75.             string newValue = "my" + char.ToUpper(str3[0]).ToString() + str3.Substring(1);
    76.             templateContent = str4.Replace("#SCRIPTNAME_LOWER#", newValue);
    77.          }
    79.          return RProjectWindowUtil.CreateScriptAssetWithContent(pathName, templateContent);
    80.       }
    82.       public static Object CreateScriptAssetWithContent(
    83.          string pathName,
    84.          string templateContent)
    85.       {
    86.          return (UnityEngine.Object) CreateScriptAssetWithContentMethod()
    87.             .Invoke(null, new object[] {pathName, templateContent});
    88.       }
    90. #if UNITY_2018_4
    91.       public static void CreateScriptAsset(string templatePath, string destName)
    92.       {
    93.          CreateScriptAssetMethod()?.Invoke(null, new object[] {templatePath, destName});
    94.       }
    95. #endif
    97. #if UNITY_2020_2_OR_NEWER
    98.       internal static string PreprocessScriptAssetTemplate(string pathName, string resourceContent)
    99.       {
    100.          return (string) PreprocessScriptAssetTemplateMethod()
    101.             .Invoke(null, new object[] {pathName, resourceContent});
    102.       }
    103. #endif
    105.       #endregion
    107.       #region INTERNAL
    109. #if UNITY_2018_4
    110.       private static MethodInfo CreateScriptAssetMethod()
    111.       {
    112.          return ProjectWindowUtilType().GetTypeInfo().GetDeclaredMethod("CreateScriptAsset");
    113.       }
    114. #endif
    116.       private static MethodInfo CreateScriptAssetWithContentMethod()
    117.       {
    118.          return ProjectWindowUtilType().GetTypeInfo().GetDeclaredMethod("CreateScriptAssetWithContent");
    119.       }
    121. #if UNITY_2020_2_OR_NEWER
    122.       private static MethodInfo PreprocessScriptAssetTemplateMethod()
    123.       {
    124.          return ProjectWindowUtilType().GetTypeInfo().GetDeclaredMethod("PreprocessScriptAssetTemplate");
    125.       }
    126. #endif
    128.       private static Type ProjectWindowUtilType()
    129.       {
    130.          return AppDomain.CurrentDomain
    131.             .GetAssemblies()
    132.             .First(e => e.FullName == assemblyName)
    133.             .GetTypes().First(e => e.Name == "ProjectWindowUtil");
    134.       }
    136.       #endregion
    137.    }
    138. }
    Code (csharp):
    2. using System;
    3. using System.IO;
    4. using UnityEditor;
    5. using UnityEditor.ProjectWindowCallback;
    6. using UnityEngine;
    7. using Object = UnityEngine.Object;
    9. namespace CustomScriptCreator
    10. {
    11.    internal class CustomScriptMenu
    12.    {
    13.       private static string TemplateDirectory => Application.dataPath + "/Editor/Script Templates/";
    14.       private static string EditorWindowScriptPath =>
    15. #if UNITY_2020_2_OR_NEWER
    16.                                                       TemplateDirectory + "EditorWindow_2020_2_OR_NEWER.cs.txt";
    17. #else
    18.                                                       TemplateDirectory + "EditorWindow_2020_1_OR_LOWER.cs.txt";
    19. #endif
    20.       private static string EditorScriptPath =>
    21. #if UNITY_2020_2_OR_NEWER
    22.                                                       TemplateDirectory + "Editor_2020_2_OR_NEWER.cs.txt";
    23. #else
    24.                                                 TemplateDirectory + "Editor_2020_1_OR_LOWER.cs.txt";
    25. #endif
    26.       private static string SingletonScriptPath => TemplateDirectory + "Singleton.cs.txt";
    27.       private static string DynamicSingletonScriptPath => TemplateDirectory + "DynamicSingleton.cs.txt";
    28.       private static string StaticSingletonScriptPath => TemplateDirectory + "StaticSingleton.cs.txt";
    30.       private const string MENU = "Assets/Create/Predefined Scripts/";
    31.       private const int ORDER = 80;
    33.       [MenuItem(MENU + "Editor Window", false, ORDER)]
    34.       private static void CreateEditorWindowScript()
    35.       {
    36.          RProjectWindowUtil.CreateScriptAssetFromTemplateFile(EditorWindowScriptPath, "NewEditorWindow.cs");
    37.       }
    39.       [MenuItem(MENU + "Editor", false, ORDER + 1)]
    40.       private static void CreateEditorScript()
    41.       {
    42.          string defaultNewFileName = "NewEditor.cs";
    44.          if (EditorScriptPath == null)
    45.          {
    46.             throw new ArgumentNullException(nameof(EditorScriptPath));
    47.          }
    49.          if (!File.Exists(EditorScriptPath))
    50.          {
    51.             throw new FileNotFoundException("The template file \"" + EditorScriptPath + "\" could not be found.",
    52.                EditorScriptPath);
    53.          }
    55.          if (string.IsNullOrEmpty(defaultNewFileName))
    56.          {
    57.             defaultNewFileName = Path.GetFileName(EditorScriptPath);
    58.          }
    60.          Texture2D image = EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D;
    62.          RProjectWindowUtil.StartNameEditingIfProjectWindowExists(0,
    63.             ScriptableObject.CreateInstance<DoCreateEditorScriptAsset>(), defaultNewFileName, image,
    64.             EditorScriptPath);
    65.       }
    67.       [MenuItem(MENU + "Singleton", false, ORDER + 20)]
    68.       private static void CreateSingletonScript()
    69.       {
    70.          string defaultNewFileName = "MySingleton.cs";
    72.          if (!File.Exists(SingletonScriptPath))
    73.          {
    74.             throw new FileNotFoundException("The template file \"" + SingletonScriptPath + "\" could not be found.",
    75.                SingletonScriptPath);
    76.          }
    78.          Texture2D image = EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D;
    80.          RProjectWindowUtil.StartNameEditingIfProjectWindowExists(0,
    81.             ScriptableObject.CreateInstance<DoCreateEditorScriptAsset>(), defaultNewFileName, image,
    82.             SingletonScriptPath);
    83.       }
    85.       [MenuItem(MENU + "DynamicSingleton", false, ORDER + 21)]
    86.       private static void CreateDynamicSingletonScript()
    87.       {
    88.          string defaultNewFileName = "MyDynamicSingleton.cs";
    90.          if (!File.Exists(DynamicSingletonScriptPath))
    91.          {
    92.             throw new FileNotFoundException("The template file \"" + DynamicSingletonScriptPath + "\" could not be found.",
    93.                DynamicSingletonScriptPath);
    94.          }
    96.          Texture2D image = EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D;
    98.          RProjectWindowUtil.StartNameEditingIfProjectWindowExists(0,
    99.             ScriptableObject.CreateInstance<DoCreateEditorScriptAsset>(), defaultNewFileName, image,
    100.             DynamicSingletonScriptPath);
    101.       }
    103.       [MenuItem(MENU + "StaticSingleton", false, ORDER + 22)]
    104.       private static void CreateStaticSingletonScript()
    105.       {
    106.          string defaultNewFileName = "MyStaticSingleton.cs";
    108.          if (!File.Exists(StaticSingletonScriptPath))
    109.          {
    110.             throw new FileNotFoundException("The template file \"" + StaticSingletonScriptPath + "\" could not be found.",
    111.                StaticSingletonScriptPath);
    112.          }
    114.          Texture2D image = EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D;
    116.          RProjectWindowUtil.StartNameEditingIfProjectWindowExists(0,
    117.             ScriptableObject.CreateInstance<DoCreateEditorScriptAsset>(), defaultNewFileName, image,
    118.             StaticSingletonScriptPath);
    119.       }
    121.       public class DoCreateEditorScriptAsset : EndNameEditAction
    122.       {
    123.          public override void Action(int instanceId, string pathName, string resourceFile)
    124.          {
    125.             string resourceContent = File.ReadAllText(resourceFile);
    126.             resourceContent = EditorPreprocessScriptAssetTemplate(pathName, resourceContent);
    128.             string processed
    129. #if UNITY_2020_2_OR_NEWER
    130.                = RProjectWindowUtil.PreprocessScriptAssetTemplate(pathName, resourceContent);
    131.             Object asset = RProjectWindowUtil.CreateScriptAssetWithContent(pathName, processed);
    132. #else
    133.                = resourceContent;
    134.             Object asset = RProjectWindowUtil.CreateScriptAssetFromTemplate(pathName, processed);
    135. #endif
    136.             RProjectWindowUtil.ShowCreatedAsset(asset);
    137.          }
    138.       }
    140.       private static string EditorPreprocessScriptAssetTemplate(string pathName, string resourceContent)
    141.       {
    142.          string withoutExtension = Path.GetFileNameWithoutExtension(pathName);
    144.          string targetClassName = "";
    146.          if (withoutExtension.EndsWith("Inspector", StringComparison.OrdinalIgnoreCase))
    147.          {
    148.             targetClassName = withoutExtension.Replace("Inspector", "");
    149.             targetClassName = targetClassName.Replace("inspector", "");
    150.          }
    151.          else if (withoutExtension.EndsWith("Editor", StringComparison.OrdinalIgnoreCase))
    152.          {
    153.             targetClassName = withoutExtension.Replace("Editor", "");
    154.             targetClassName = targetClassName.Replace("editor", "");
    155.          }
    157.          const string wildcard = "#CUSTOMEDITORATTRIBUTE#";
    159.          if (string.IsNullOrEmpty(targetClassName))
    160.          {
    161.             return resourceContent.Replace(wildcard, "");
    162.          }
    163.          else
    164.          {
    165.             return resourceContent.Replace(wildcard, $"[CustomEditor(typeof({targetClassName}))]");
    166.          }
    167.       }
    169.    }
    170. }

    Attached Files:

    useraccount1 and NotaNaN like this.
  44. FiveXGames


    Apr 27, 2016
    I don't know if is already suggested, but something great would be a "gizmos draw distance".

    Normally I don't want to see gizmos 2000 units away, so if I could decrease it would be great.

    Also it will help a lot with the performance avoiding drawing all the gizmos in the scene when not needed, for example when checking a local event.

    P.S: Same with the physics debugger

    ¿This is the correct place? ¿How can I suggest it?
    Andresmonte, useraccount1 and NotaNaN like this.
  45. ryanlin138


    Aug 28, 2019
  46. svenneve


    May 14, 2013
    This sh!t, and every other Editor and Application blocking progress bar since version 2020.

    Attached Files:

  47. sand_lantern


    Sep 15, 2017
    From what I recall in the discussion boards, that progress bar runs on its own thread and doesn't actually block anything. However it pops up when something blocking is happening. In older versions of unity, they were still blocking, it was just less in your face because the editor was just hanging up until it finished.

    If you want to complain about something, let's complain about how laggy the editor is, recompiling issues and other such things, not better information provided to us when there are issues happening.
    useraccount1 likes this.
  48. svenneve


    May 14, 2013
    I posted in another thread before (not sure where anymore), but it's not just the Application quit messgae.
    It's laggy, slow and blocking on so many messages now. Application.RefreshingDatabase, Editor.RepaintingGUI, etc, etc.
    People claim this happened in the past as well, only it didn't show the message, to them I say hogwash. Projects that worked perfectly fine in 2018/2019 are an unworkable lag fest in 2020.
    I have no idea what happened between those version and 2020, but something is seriously wrong.
  49. useraccount1


    Mar 31, 2018
    For me, it's exactly the opposite. Back in 2019 sometimes the editor could freeze for several minutes without telling what's happening. You either get used to that or were checking whether I should shut down unity before my pc will crash.

    In 2020.1 multiple processes got several times faster and since then I haven't got even one freeze that took over 1 minute.

    I suppose noticing freezes is one thing, but there is always a possibility some processes got slower and slipped through unity QA.
  50. sand_lantern


    Sep 15, 2017
    Be that as it may, my point stands. If it IS different than old versions (which I kinda doubt being as how old versions are so laggy in so many situations and you just get used to it), then it's some other regression issue in 2020. Still not a problem with the loading bar.