Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Feedback New "Scripting Define Symbols" UI

Discussion in '2020.2 Beta' started by Peter77, Oct 8, 2020.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    Hello heroes from the QoL team :)

    Thank you for the recent Quality of Life blog-post.
    upload_2020-10-8_9-39-44.png
    https://blogs.unity3d.com/2020/10/07/the-road-to-2021-team-quality-of-life/

    Here is a screenshot from my hobby project. Projects at work have about 15 scripting defines.
    upload_2020-10-8_9-40-8.png

    Unfortunately, from an usage point of view, this being a list now is actually a step back for me. :( The main reason why I find it less useful, is because I no longer can copy and paste all scripting symbols.

    I would find it much more user friendly if this can be changed to a single multi-line word-wrapped text-field instead. A new line, space, comma, semicolon, etc are used as separators. This would allow me to much more efficiently add/remove/copy/paste scripting symbols.
     
    Last edited: Oct 8, 2020
    Singtaa, jGate99 and Havokki like this.
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,167
    It's for sure an improvement for us over the old version, as it's a lot easier to read - when do you copy-paste the define symbols?

    If it was a text-field that tried to be smart about dealing with whitespace, it should show the final result as a string somewhere in the UI, so you don't run into gotchas.
     
    Neonlyte likes this.
  3. TheZombieKiller

    TheZombieKiller

    Joined:
    Feb 8, 2013
    Posts:
    256
    How about instead it detects semicolons in whatever you're pasting? So you could paste "A;B;C" into one of the entries and it'll turn that into several automatically. That way, we keep the list UI while still being able to paste in defines.
     
    jGate99 and Peter77 like this.
  4. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,825
    Yes, same here
    we need both, list + paste string of all the defines
     
  5. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    +1 +1 +1

    +1. Also if the that list supports multi-selections, and copying those selected entries would fill the clipboard with the standard semicolon-seperated string, this would keep things consistent.
     
  6. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    But why 15 define flags, though, and why do you have to copy them around? Are those for some mega-libraries?
     
    jGate99 likes this.
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,394
    We use scripting defines to toggle (development) features in the game.

    For example in debug and development builds we support cheats by adding the
    COMPANYNAME_CHEATS
    to the scripting symbols.

    Unity stores scripting defines per platform. If I add or remove a scripting define I often want to do this for all platforms. Or to transfer scripting defines from one project to another.
     
  8. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    One of the solutions to your issue @Peter77 would be to use editor scripts to automate define symbols for the platforms. At work there is an editor menu for enabling/disable some symbols that get applied automatically. This would be my counterargument to you.

    As for why you need to copy and paste from project to project, that's another thing...
     
    Peter77 likes this.
  9. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,825
    Yes, centralized codebase used in different projects with some features off and on with help of defines
     
  10. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    QoL code wise for this would be nice too, instead of dealing with a single flat string that other libraries would mess with, I'd rather prefer a single method overload to the questionably long method name.

    Code (CSharp):
    1. ProjectSettings.SetScriptingDefineSymbolForGroup(BuildTargetGroup.Standalone, "DEBUG", true);
     
    FakeByte and Peter77 like this.
  11. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,083
    manurocker95 and Kirsche like this.
  12. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    I mean... the one we currently have is good enough, Im not a sure if a designer would be responsible for even looking at or managing the define symbols. The UI seems like the wrong tree bark, we could've had the old one even, just a better API would be tremendous.
     
  13. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    I hope it could be a toggle list or a preset. That makes more easy to switch between different settings.
     
    valentingurkov likes this.
  14. justinas_p

    justinas_p

    Unity Technologies

    Joined:
    Nov 7, 2016
    Posts:
    6
    Hello!

    Thanks for the report. We are already working on improvements for this, so it should land in the near future. Also, multiple defines can be pasted to one field and they will be separated after applying changes.
     
    Singtaa, mahdi_jeddi and Peter77 like this.
  15. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    160
    @justinas_p In our setup we use define symbols to switch between demo and full game releases. The problem is that when anyone in the team adds the demo symbol, it changes their ProjectSettings.asset and it often accidentally ends up in the VCS. It would be great if Unity provided some support for such setups, for example:
    • Add some way to define "local define symbols", outside of the ProjectSettings.asset, in a file which isn't stored in VCS.
    • Add some form of official support for "project configurations".
     
  16. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    190
    Copy defines + Paste never worked for me and I just tested it on 2021.3f1.

    This works like a charm <3
     
  17. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    57
    Just want to add that this new UI is still bugged up the wazoo in the the last 3 version.

    Removed, renamed or newly added preprocessor defines are simply not working in the assembly.

    It is so unreliable at the moment I am the point of simply rewriting the entire code base of our game because that would at least give a reliable build.